• 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: rss_monitor03.sh
15#
16# Description: Verify /proc/pid/rss_threshold value
17#
18# Authors:     Wulisai - wulisai@h-partners.com
19#
20# History:     Oct 24 2022 - init scripts
21#
22################################################################################
23source tst_oh.sh
24
25do_setup()
26{
27	zcat /proc/config.gz | grep CONFIG_RSS_THRESHOLD=y || tst_res TCONF "CONFIG_RSS_THRESHOLD=y not satisfied!"
28}
29
30do_test()
31{
32
33	local ret = 0
34	pid=$(ps -ef | grep com.ohos.systemui | awk 'NR==1 {print $2}')
35	echo 2000 > /proc/$pid/rss_threshold
36	value=$(cat /proc/$pid/rss_threshold | awk -F ':' '{print$2}'| awk '{print$1}')
37	if [ "$value"x = "2000"x ]; then
38		tst_res TPASS "rss_threshold value correct."
39        else
40		tst_res TFAIL "rss_threshold value incorrect."
41		((ret++))
42        fi
43
44
45}
46
47do_clean()
48{
49
50}
51
52do_setup
53do_test
54do_clean
55tst_exit
56