• 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: cpuisolation08.sh
18#
19# Description: check global_state node status about CPU isolation
20#
21# Authors:     liudanning - liudanning@h-partners.com
22#
23# History:     Mar 24 2022 - init scripts
24#
25################################################################################
26
27
28source tst_oh.sh
29
30do_setup()
31{
32
33}
34
35do_test()
36{
37    local ret=0
38    dir_name=/sys/devices/system/cpu/cpu0/core_ctl
39    global_state=${dir_name}/global_state
40
41    cat $global_state
42    if [ $? -eq 0 ]; then
43        tst_res TPASS "Node global_state can be read."
44    else
45        tst_res TFAIL "Node global_state status error."
46        ret=$(( $ret + 1 ))
47    fi
48
49    echo 1 > $global_state
50    if [ $? -ne 0 ]; then
51        tst_res TPASS "Node global_state can be write."
52    else
53        tst_res TFAIL "Node global_state status error."
54        ret=$(( $ret + 1 ))
55    fi
56    echo ret=$ret
57    if [ $ret -eq 0 ]; then
58        tst_res TPASS "global_state node status is right."
59    else
60        tst_res TFAIL "global_state node status is wrong!"
61    fi
62}
63
64do_clean()
65{
66
67}
68
69do_setup
70do_test
71do_clean
72tst_exit