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