• 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# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS,
9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10# See the License for the specific language governing permissions and
11# limitations under the License.
12#
13################################################################################
14# File: memory_control03.sh
15#
16# Description: Verify /dev/memcg/memory.name
17#
18# Authors:     Wu Lisai - wulisai@huawei-partners.com
19#
20# History:     Nov 18 2022 - init scripts
21#
22################################################################################
23source tst_oh.sh
24
25do_setup()
26{
27	zcat /proc/config.gz | grep CONFIG_HYPERHOLD_MEMCG=y || tst_res TCONF "CONFIG_HYPERHOLD_MEMCG=y not satisfied!"
28}
29
30do_test()
31{
32       tst_res TINFO "Start to verify mem ."
33
34        echo "test_cgroup" > /dev/memcg/memory.name
35        mem=$(cat /dev/memcg/memory.name)
36        echo $mem
37        if [ "$mem"x = "test_cgroup"x ]; then
38               tst_res TPASS "memory_control default value correct."
39        else
40               tst_res TFAIL "memory_control default value incorrect."
41        fi
42}
43
44do_clean()
45{
46
47}
48
49do_setup
50do_test
51do_clean
52tst_exit
53