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