• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2################################################################################
3#
4# Copyright (C) 2022 Huawei Device Co., Ltd.
5# SPDX-License-Identifier: GPL-2.0
6#
7# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT.
8# Do not use in new code.
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16################################################################################
17# File: mem_debug01.sh
18#
19# Description: Static memory reservation query test
20#
21# Authors:     Wangyuting - wangyuting36@huawei.com
22#
23# History:     Mar 19 2022 - init scripts
24#
25################################################################################
26source tst_oh.sh
27
28do_setup()
29{
30    zcat /proc/config.gz | grep CONFIG_DEBUG_FS=y || tst_res TCONF "CONFIG_DEBUG_FS=y not satisfied!"
31}
32
33do_test()
34{
35    local rmem_lines=$(cat /sys/kernel/debug/dt_reserved_mem/dt_reserved_memory | wc -l)
36
37    if [ $rmem_lines -gt 1 ]; then
38        tst_res TPASS "Static memory reservation query test pass."
39    else
40        tst_res TFAIL "Static memory reservation query test failed!"
41    fi
42}
43
44do_clean()
45{
46
47}
48
49do_setup
50do_test
51do_clean
52tst_exit