diff --git a/kernel.mk b/kernel.mk index dc3343b5565c27555c3beaedcc4a99de9b641b5f..ee391f181b62adb5bcbda6f43dcde76977b2acee 100644 --- a/kernel.mk +++ b/kernel.mk @@ -67,7 +67,6 @@ PRODUCT_PATCH_FILE := $(OHOS_BUILD_HOME)/vendor/hisilicon/watchos/patches/$(DEVI SMALL_PATCH_FILE := $(DEVICE_PATCH_DIR)/$(DEVICE_NAME)_$(BUILD_TYPE).patch KERNEL_IMAGE_FILE := $(KERNEL_SRC_TMP_PATH)/arch/$(KERNEL_ARCH)/boot/$(KERNEL_IMAGE) DEFCONFIG_FILE := $(DEVICE_NAME)_$(BUILD_TYPE)_defconfig -NEWIP_PATCH_FILE := $(OHOS_BUILD_HOME)/foundation/communication/sfc/newip/apply_newip.sh export KBUILD_OUTPUT=$(KERNEL_OBJ_TMP_PATH) @@ -92,9 +91,6 @@ ifneq ($(findstring $(BUILD_TYPE), small),) $(hide) cd $(KERNEL_SRC_TMP_PATH) && patch -p1 < $(SMALL_PATCH_FILE) endif -ifeq ($(NEWIP_PATCH_FILE), $(wildcard $(NEWIP_PATCH_FILE))) - $(hide) $(NEWIP_PATCH_FILE) $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(DEVICE_NAME) ${KERNEL_VERSION} -endif $(hide) cp -rf $(KERNEL_CONFIG_PATH)/. $(KERNEL_SRC_TMP_PATH)/ $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) distclean $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(DEFCONFIG_FILE) diff --git a/test/BUILD.gn b/test/BUILD.gn index b54db217e515f9c8fb2ef8525a540fc01af058e0..9f03f885d9111cc300e8ca4ad90d58d16333bfa5 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -19,7 +19,10 @@ if (is_standard_system) { if (is_standard_system) { module_output_path = "linuxkerneltest/" - linuxkerneltest_public_deps = [ "//third_party/googletest:gtest_main" ] + linuxkerneltest_public_deps = [ + "//third_party/bounds_checking_function:libsec_shared", + "//third_party/googletest:gtest_main", + ] ohos_unittest("accesstokenid_test") { module_out_path = module_output_path @@ -29,6 +32,14 @@ if (is_standard_system) { subsystem_name = "kernel" } + ohos_unittest("rtg_test") { + module_out_path = module_output_path + sources = [ "unittest/rtg/rtg_test.cpp" ] + deps = linuxkerneltest_public_deps + part_name = "linux" + subsystem_name = "kernel" + } + script_dir = "kernel/linux/build/test/moduletest/runtest" action("init_runtest") { script = "init_runtest.sh" @@ -46,6 +57,7 @@ group("linuxkerneltest") { deps = [ ":accesstokenid_test", ":init_runtest", + ":rtg_test", "fuzztest:fuzztest", #"kernel_ltp:HatsKernelTest", diff --git a/test/fuzztest/accesstokenid/accessftokenidgrptest_fuzzer/accessftokenidgrptest_fuzzer.cpp b/test/fuzztest/accesstokenid/accessftokenidgrptest_fuzzer/accessftokenidgrptest_fuzzer.cpp index 3530012766692d56d13a752c15082be7c810b157..bf7230bca3e750a224b72693d447ee831b008d4a 100644 --- a/test/fuzztest/accesstokenid/accessftokenidgrptest_fuzzer/accessftokenidgrptest_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/accessftokenidgrptest_fuzzer/accessftokenidgrptest_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/accessftokenidgrptestother_fuzzer/accessftokenidgrptestother_fuzzer.cpp b/test/fuzztest/accesstokenid/accessftokenidgrptestother_fuzzer/accessftokenidgrptestother_fuzzer.cpp index 1138272cbb693d58ed065db31f1ae9403115b3f5..b2b659daa9ac63acb1f6ce3b376befe78a9fe14b 100644 --- a/test/fuzztest/accesstokenid/accessftokenidgrptestother_fuzzer/accessftokenidgrptestother_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/accessftokenidgrptestother_fuzzer/accessftokenidgrptestother_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/accessftokenidthreadtest_fuzzer/accessftokenidthreadtest_fuzzer.cpp b/test/fuzztest/accesstokenid/accessftokenidthreadtest_fuzzer/accessftokenidthreadtest_fuzzer.cpp index efcbaecbff1561f6dc8580a9f3d1150742da5a44..a1128243f4bd63caffbfbb18fc37f7661a163ed9 100644 --- a/test/fuzztest/accesstokenid/accessftokenidthreadtest_fuzzer/accessftokenidthreadtest_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/accessftokenidthreadtest_fuzzer/accessftokenidthreadtest_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/accesstokenidgrptest_fuzzer/accesstokenidgrptest_fuzzer.cpp b/test/fuzztest/accesstokenid/accesstokenidgrptest_fuzzer/accesstokenidgrptest_fuzzer.cpp index fe42be4a4502914b77850971a8ced5b44c607bc9..0882cc5402158f81a30b779813d8e4f6485981f9 100644 --- a/test/fuzztest/accesstokenid/accesstokenidgrptest_fuzzer/accesstokenidgrptest_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/accesstokenidgrptest_fuzzer/accesstokenidgrptest_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/accesstokenidgrptestother_fuzzer/accesstokenidgrptestother_fuzzer.cpp b/test/fuzztest/accesstokenid/accesstokenidgrptestother_fuzzer/accesstokenidgrptestother_fuzzer.cpp index 93fdd1afcfbd01f2561ab023fb4abfe37f3f4d41..4903fd9e3835468d7722d9fe5e7829e050b1a270 100644 --- a/test/fuzztest/accesstokenid/accesstokenidgrptestother_fuzzer/accesstokenidgrptestother_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/accesstokenidgrptestother_fuzzer/accesstokenidgrptestother_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/accesstokenidthreadtest_fuzzer/accesstokenidthreadtest_fuzzer.cpp b/test/fuzztest/accesstokenid/accesstokenidthreadtest_fuzzer/accesstokenidthreadtest_fuzzer.cpp index 99a2124ebdb02c63f655a23dfb55f904bd56accb..43d5ff9c46b21a76e1ebff42c330b949be9ea539 100644 --- a/test/fuzztest/accesstokenid/accesstokenidthreadtest_fuzzer/accesstokenidthreadtest_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/accesstokenidthreadtest_fuzzer/accesstokenidthreadtest_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/getftokenidcmdcorrect_fuzzer/getftokenidcmdcorrect_fuzzer.cpp b/test/fuzztest/accesstokenid/getftokenidcmdcorrect_fuzzer/getftokenidcmdcorrect_fuzzer.cpp index e8ea26b6fbb8fc2cd28c1889de46cc43fcab8b85..b93abca6047226d98626dcab998c8fa810a72296 100644 --- a/test/fuzztest/accesstokenid/getftokenidcmdcorrect_fuzzer/getftokenidcmdcorrect_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/getftokenidcmdcorrect_fuzzer/getftokenidcmdcorrect_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/getftokenidcmderror_fuzzer/getftokenidcmderror_fuzzer.cpp b/test/fuzztest/accesstokenid/getftokenidcmderror_fuzzer/getftokenidcmderror_fuzzer.cpp index 11391f040d3e5c65b1b6ecfcf536d48ff8a16bfa..6429c2b83623d65539d960646f97d010978f21d4 100644 --- a/test/fuzztest/accesstokenid/getftokenidcmderror_fuzzer/getftokenidcmderror_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/getftokenidcmderror_fuzzer/getftokenidcmderror_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/getftokenidnullptr_fuzzer/getftokenidnullptr_fuzzer.cpp b/test/fuzztest/accesstokenid/getftokenidnullptr_fuzzer/getftokenidnullptr_fuzzer.cpp index c32e4c1f7669d4176804f88140911f1f063ca2fd..80fdd53acfacb0a7c97fc3979aaf7c50e2695ab8 100644 --- a/test/fuzztest/accesstokenid/getftokenidnullptr_fuzzer/getftokenidnullptr_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/getftokenidnullptr_fuzzer/getftokenidnullptr_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/gettokenidcmdcorrect_fuzzer/gettokenidcmdcorrect_fuzzer.cpp b/test/fuzztest/accesstokenid/gettokenidcmdcorrect_fuzzer/gettokenidcmdcorrect_fuzzer.cpp index 41f863fb2596d6ea5778318d088499d65eb8e798..7f5cf701f2ce320c6deff22d2c5264232eb29b7b 100644 --- a/test/fuzztest/accesstokenid/gettokenidcmdcorrect_fuzzer/gettokenidcmdcorrect_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/gettokenidcmdcorrect_fuzzer/gettokenidcmdcorrect_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/gettokenidcmderror_fuzzer/gettokenidcmderror_fuzzer.cpp b/test/fuzztest/accesstokenid/gettokenidcmderror_fuzzer/gettokenidcmderror_fuzzer.cpp index c26f8e605b61ee2e70cefa7ba25a45766fd59681..057788a434add8c0af25bc9e02e3c54bb1bc8ad7 100644 --- a/test/fuzztest/accesstokenid/gettokenidcmderror_fuzzer/gettokenidcmderror_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/gettokenidcmderror_fuzzer/gettokenidcmderror_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/gettokenidnullptr_fuzzer/gettokenidnullptr_fuzzer.cpp b/test/fuzztest/accesstokenid/gettokenidnullptr_fuzzer/gettokenidnullptr_fuzzer.cpp index 0ebc7fa6df46c419468e120cd187de0d7e9f8121..2067aee1046c52319ca65365aac70898faf23e52 100644 --- a/test/fuzztest/accesstokenid/gettokenidnullptr_fuzzer/gettokenidnullptr_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/gettokenidnullptr_fuzzer/gettokenidnullptr_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/include/accesstokenidcommon.h b/test/fuzztest/accesstokenid/include/accesstokenidcommon.h index d547728dcb819fd89cc14d773d29a0aa42143784..55f1177c9036e8d972d9759d9f2064b5e2df1d64 100644 --- a/test/fuzztest/accesstokenid/include/accesstokenidcommon.h +++ b/test/fuzztest/accesstokenid/include/accesstokenidcommon.h @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -68,7 +65,7 @@ int SetfTokenid(unsigned long long *ftoken); void SetUidAndGrp(); void SetUidAndGrpOther(); void GetCurToken(unsigned long long *token); -void SetRandTokenAndCheck(unsigned long long *dataToken); +void SetRandTokenAndCheck(const unsigned long long *dataToken); void TokenTest(unsigned long long *dataToken); void ThreadTest(unsigned long long *dataToken); int AccessTokenidThreadTest(uint8_t *dataToken); @@ -76,7 +73,7 @@ int AccessTokenidGrpTest(uint8_t *dataToken); int AccessTokenidGrpTestOther(uint8_t *dataToken); void GetCurfToken(unsigned long long *ftoken); -void SetRandfTokenAndCheck(unsigned long long *dataFtoken); +void SetRandfTokenAndCheck(const unsigned long long *dataFtoken); void FTokenTest(unsigned long long *dataFtoken); void ThreadTest(unsigned long long *dataFtoken); int AccessfTokenidThreadTest(uint8_t *dataFtoken); diff --git a/test/fuzztest/accesstokenid/setftokenidcmdcorrect_fuzzer/setftokenidcmdcorrect_fuzzer.cpp b/test/fuzztest/accesstokenid/setftokenidcmdcorrect_fuzzer/setftokenidcmdcorrect_fuzzer.cpp index bec5a2c73f59d69e2ed48397a2c9ad3b352e5a76..9f05892b6a25471b338091dd1a4664e7aa092676 100644 --- a/test/fuzztest/accesstokenid/setftokenidcmdcorrect_fuzzer/setftokenidcmdcorrect_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/setftokenidcmdcorrect_fuzzer/setftokenidcmdcorrect_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/setftokenidcmderror_fuzzer/setftokenidcmderror_fuzzer.cpp b/test/fuzztest/accesstokenid/setftokenidcmderror_fuzzer/setftokenidcmderror_fuzzer.cpp index 8a74ae30a81c1105ca6fe48a1305f202cc20732a..bb030d490298edc075520b097fa34bbeb3b2a1d4 100644 --- a/test/fuzztest/accesstokenid/setftokenidcmderror_fuzzer/setftokenidcmderror_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/setftokenidcmderror_fuzzer/setftokenidcmderror_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/setftokenidnullptr_fuzzer/setftokenidnullptr_fuzzer.cpp b/test/fuzztest/accesstokenid/setftokenidnullptr_fuzzer/setftokenidnullptr_fuzzer.cpp index ff46291dad0284fab4c17cf073054b1f82c022f2..403b7d3e4f6f57fb3e9d60374c2412c12cd0e9ca 100644 --- a/test/fuzztest/accesstokenid/setftokenidnullptr_fuzzer/setftokenidnullptr_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/setftokenidnullptr_fuzzer/setftokenidnullptr_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/settokenidcmdcorrect_fuzzer/settokenidcmdcorrect_fuzzer.cpp b/test/fuzztest/accesstokenid/settokenidcmdcorrect_fuzzer/settokenidcmdcorrect_fuzzer.cpp index 3fdd9a6e664c44ea8a7b2eee970d8ae280650eaf..6e7bbf2888c0825acdfd064421cbdda01560cd7d 100644 --- a/test/fuzztest/accesstokenid/settokenidcmdcorrect_fuzzer/settokenidcmdcorrect_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/settokenidcmdcorrect_fuzzer/settokenidcmdcorrect_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/settokenidcmderror_fuzzer/settokenidcmderror_fuzzer.cpp b/test/fuzztest/accesstokenid/settokenidcmderror_fuzzer/settokenidcmderror_fuzzer.cpp index 899bb77a7c16f2679e22fdca73f740ede3ebb15f..af142d456d1d21f99fefc60c4ed69161b3357696 100644 --- a/test/fuzztest/accesstokenid/settokenidcmderror_fuzzer/settokenidcmderror_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/settokenidcmderror_fuzzer/settokenidcmderror_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/settokenidnullptr_fuzzer/settokenidnullptr_fuzzer.cpp b/test/fuzztest/accesstokenid/settokenidnullptr_fuzzer/settokenidnullptr_fuzzer.cpp index a79ecf7fa2ef259521cdc4a6bf1da55769757811..bad6580cf6b8255d4adc6d4098120db7633b76f0 100644 --- a/test/fuzztest/accesstokenid/settokenidnullptr_fuzzer/settokenidnullptr_fuzzer.cpp +++ b/test/fuzztest/accesstokenid/settokenidnullptr_fuzzer/settokenidnullptr_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/accesstokenid/src/accesstokenidcommon.cpp b/test/fuzztest/accesstokenid/src/accesstokenidcommon.cpp index b9fa2881b08619ddd19a40fdf4ef652d85b8052d..fc35c97e216920cab3f9db9a097e4cf4854b5d20 100644 --- a/test/fuzztest/accesstokenid/src/accesstokenidcommon.cpp +++ b/test/fuzztest/accesstokenid/src/accesstokenidcommon.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -94,7 +91,7 @@ void SetUidAndGrpOther() return; } -void SetRandTokenAndCheck(unsigned long long *dataToken) +void SetRandTokenAndCheck(const unsigned long long *dataToken) { pid_t pid = getpid(); pid_t tid = syscall(__NR_gettid); @@ -217,7 +214,7 @@ int SetfTokenid(unsigned long long *ftoken) return 0; } -void SetRandfTokenAndCheck(unsigned long long *dataFtoken) +void SetRandfTokenAndCheck(const unsigned long long *dataFtoken) { pid_t pid = getpid(); pid_t tid = syscall(__NR_gettid); diff --git a/test/fuzztest/hc_node/hcenable_fuzzer/hcenable_fuzzer.cpp b/test/fuzztest/hc_node/hcenable_fuzzer/hcenable_fuzzer.cpp index 5bd5c3396ca89449da45361f20121dcc061d79e8..2668d4c90f9ead896f7ae7fccbeca438d71b9289 100644 --- a/test/fuzztest/hc_node/hcenable_fuzzer/hcenable_fuzzer.cpp +++ b/test/fuzztest/hc_node/hcenable_fuzzer/hcenable_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/hc_node/hchotdatalowerlimit_fuzzer/hchotdatalowerlimit_fuzzer.cpp b/test/fuzztest/hc_node/hchotdatalowerlimit_fuzzer/hchotdatalowerlimit_fuzzer.cpp index a1bed1183411739f0a23dd3e31968a7849fc33e5..49d7010db4578274cc542d2f5b010d18a80d4aaa 100644 --- a/test/fuzztest/hc_node/hchotdatalowerlimit_fuzzer/hchotdatalowerlimit_fuzzer.cpp +++ b/test/fuzztest/hc_node/hchotdatalowerlimit_fuzzer/hchotdatalowerlimit_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/hc_node/hchotdatawaterline_fuzzer/hchotdatawaterline_fuzzer.cpp b/test/fuzztest/hc_node/hchotdatawaterline_fuzzer/hchotdatawaterline_fuzzer.cpp index 5a43267b71b17ada9f13fc39583ffcb73d964e23..f40fa837d5a469d7fe5ce187d2952aea58688318 100644 --- a/test/fuzztest/hc_node/hchotdatawaterline_fuzzer/hchotdatawaterline_fuzzer.cpp +++ b/test/fuzztest/hc_node/hchotdatawaterline_fuzzer/hchotdatawaterline_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/hc_node/hchotnodelowerlimit_fuzzer/hchotnodelowerlimit_fuzzer.cpp b/test/fuzztest/hc_node/hchotnodelowerlimit_fuzzer/hchotnodelowerlimit_fuzzer.cpp index 1d196682fc03940340090d66d9761cd7573d5852..923339e3f7f40977555f314bfd01548961867a23 100644 --- a/test/fuzztest/hc_node/hchotnodelowerlimit_fuzzer/hchotnodelowerlimit_fuzzer.cpp +++ b/test/fuzztest/hc_node/hchotnodelowerlimit_fuzzer/hchotnodelowerlimit_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/hc_node/hchotnodewaterline_fuzzer/hchotnodewaterline_fuzzer.cpp b/test/fuzztest/hc_node/hchotnodewaterline_fuzzer/hchotnodewaterline_fuzzer.cpp index 740b1ceecdebaff00090ca80b7ec376628882cf8..868f6dbd1cc12eb23ab60344cee58c248e57615a 100644 --- a/test/fuzztest/hc_node/hchotnodewaterline_fuzzer/hchotnodewaterline_fuzzer.cpp +++ b/test/fuzztest/hc_node/hchotnodewaterline_fuzzer/hchotnodewaterline_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/hc_node/hcwarmdatalowerlimit_fuzzer/hcwarmdatalowerlimit_fuzzer.cpp b/test/fuzztest/hc_node/hcwarmdatalowerlimit_fuzzer/hcwarmdatalowerlimit_fuzzer.cpp index ffb8780be8b8eafa7e715498801a002228de45a5..b4a59bc5074602a281ab9080b5f29c1ed089c1eb 100644 --- a/test/fuzztest/hc_node/hcwarmdatalowerlimit_fuzzer/hcwarmdatalowerlimit_fuzzer.cpp +++ b/test/fuzztest/hc_node/hcwarmdatalowerlimit_fuzzer/hcwarmdatalowerlimit_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/hc_node/hcwarmdatawaterline_fuzzer/hcwarmdatawaterline_fuzzer.cpp b/test/fuzztest/hc_node/hcwarmdatawaterline_fuzzer/hcwarmdatawaterline_fuzzer.cpp index e795d515854f986bef68101b007c96cf66182ed1..30014636a72972a384affc118dc65f669eedca47 100644 --- a/test/fuzztest/hc_node/hcwarmdatawaterline_fuzzer/hcwarmdatawaterline_fuzzer.cpp +++ b/test/fuzztest/hc_node/hcwarmdatawaterline_fuzzer/hcwarmdatawaterline_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/hc_node/hcwarmnodelowerlimit_fuzzer/hcwarmnodelowerlimit_fuzzer.cpp b/test/fuzztest/hc_node/hcwarmnodelowerlimit_fuzzer/hcwarmnodelowerlimit_fuzzer.cpp index dedd76f0cf836f6a62a10c899fbf69034a498a99..d5ec6193c2a5231c4fa029f5877cc133fb647de9 100644 --- a/test/fuzztest/hc_node/hcwarmnodelowerlimit_fuzzer/hcwarmnodelowerlimit_fuzzer.cpp +++ b/test/fuzztest/hc_node/hcwarmnodelowerlimit_fuzzer/hcwarmnodelowerlimit_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/hc_node/hcwarmnodewaterline_fuzzer/hcwarmnodewaterline_fuzzer.cpp b/test/fuzztest/hc_node/hcwarmnodewaterline_fuzzer/hcwarmnodewaterline_fuzzer.cpp index 434fa9a13787e661f7454dc98acdc83f9fab5f86..e13cde71b970124a67452b162bac5afbdd9292ec 100644 --- a/test/fuzztest/hc_node/hcwarmnodewaterline_fuzzer/hcwarmnodewaterline_fuzzer.cpp +++ b/test/fuzztest/hc_node/hcwarmnodewaterline_fuzzer/hcwarmnodewaterline_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/hc_node/include/hccommon.h b/test/fuzztest/hc_node/include/hccommon.h index 24a76a9c1c0c92e80536ec37e65c079a8d0dbfbe..ddcc1bfbb43d49a74aa9f2a29bdc5fe3559b9363 100644 --- a/test/fuzztest/hc_node/include/hccommon.h +++ b/test/fuzztest/hc_node/include/hccommon.h @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/hc_node/src/hccommon.cpp b/test/fuzztest/hc_node/src/hccommon.cpp index 26027854a22ff4c90df1f9554f4fcff4339558c4..336dd666e213c4f6190aad525e54e4c689d40acc 100644 --- a/test/fuzztest/hc_node/src/hccommon.cpp +++ b/test/fuzztest/hc_node/src/hccommon.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/anonrefaultsnapshotmininterval_fuzzer/anonrefaultsnapshotmininterval_fuzzer.cpp b/test/fuzztest/memory/anonrefaultsnapshotmininterval_fuzzer/anonrefaultsnapshotmininterval_fuzzer.cpp index 5db3956aa1692e361b5804531e2b49decb121fd6..294d1ef5bcdd3ff9d2c114850bf865ca74a6fd23 100644 --- a/test/fuzztest/memory/anonrefaultsnapshotmininterval_fuzzer/anonrefaultsnapshotmininterval_fuzzer.cpp +++ b/test/fuzztest/memory/anonrefaultsnapshotmininterval_fuzzer/anonrefaultsnapshotmininterval_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/appscore_fuzzer/appscore_fuzzer.cpp b/test/fuzztest/memory/appscore_fuzzer/appscore_fuzzer.cpp index f7a24d350385e2eea67ed4ded172d70ee7be9645..f4d8bb93830a8b08c116e3c2c7f0a9ee02b537a5 100644 --- a/test/fuzztest/memory/appscore_fuzzer/appscore_fuzzer.cpp +++ b/test/fuzztest/memory/appscore_fuzzer/appscore_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/areaanonrefaultthreshold_fuzzer/areaanonrefaultthreshold_fuzzer.cpp b/test/fuzztest/memory/areaanonrefaultthreshold_fuzzer/areaanonrefaultthreshold_fuzzer.cpp index 6331a84aac66500f45b5de7e0a8a4605b2c27506..6635aea28da53589d6fc32c5c5a7bd26e3af769f 100644 --- a/test/fuzztest/memory/areaanonrefaultthreshold_fuzzer/areaanonrefaultthreshold_fuzzer.cpp +++ b/test/fuzztest/memory/areaanonrefaultthreshold_fuzzer/areaanonrefaultthreshold_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/availbuffers_fuzzer/availbuffers_fuzzer.cpp b/test/fuzztest/memory/availbuffers_fuzzer/availbuffers_fuzzer.cpp index 403a7915a60fe7ce1ddde59026925149f5322087..5355188f51ef5bfb4758e39eaf91cffcc29702d9 100644 --- a/test/fuzztest/memory/availbuffers_fuzzer/availbuffers_fuzzer.cpp +++ b/test/fuzztest/memory/availbuffers_fuzzer/availbuffers_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/bufferratioparams_fuzzer/bufferratioparams_fuzzer.cpp b/test/fuzztest/memory/bufferratioparams_fuzzer/bufferratioparams_fuzzer.cpp index faaa3249371c9adaf73ca5166b9a52e65f4068e9..5979bd293b52980a78f1d2f0f7c69aef354128dc 100644 --- a/test/fuzztest/memory/bufferratioparams_fuzzer/bufferratioparams_fuzzer.cpp +++ b/test/fuzztest/memory/bufferratioparams_fuzzer/bufferratioparams_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/compressratio_fuzzer/compressratio_fuzzer.cpp b/test/fuzztest/memory/compressratio_fuzzer/compressratio_fuzzer.cpp index 86ed6ac8ed27eb169d6ea3fbb36b59654c15b2fe..7604ec94b3b7044e585fa7256514ccc7875ed372 100644 --- a/test/fuzztest/memory/compressratio_fuzzer/compressratio_fuzzer.cpp +++ b/test/fuzztest/memory/compressratio_fuzzer/compressratio_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/emptyroundcheckthreshold_fuzzer/emptyroundcheckthreshold_fuzzer.cpp b/test/fuzztest/memory/emptyroundcheckthreshold_fuzzer/emptyroundcheckthreshold_fuzzer.cpp index 9629597fedb3f20b931a213f4039da1aa686c19d..2b9b47ba5a9f22d39e004eb8abd08e915332f453 100644 --- a/test/fuzztest/memory/emptyroundcheckthreshold_fuzzer/emptyroundcheckthreshold_fuzzer.cpp +++ b/test/fuzztest/memory/emptyroundcheckthreshold_fuzzer/emptyroundcheckthreshold_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/emptyroundskipinterval_fuzzer/emptyroundskipinterval_fuzzer.cpp b/test/fuzztest/memory/emptyroundskipinterval_fuzzer/emptyroundskipinterval_fuzzer.cpp index 59f1585c47c44462de283be0fcda09f572747adf..108319052492eabbf48ef8669364689fee93cd9b 100644 --- a/test/fuzztest/memory/emptyroundskipinterval_fuzzer/emptyroundskipinterval_fuzzer.cpp +++ b/test/fuzztest/memory/emptyroundskipinterval_fuzzer/emptyroundskipinterval_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/forceshrinkanon_fuzzer/forceshrinkanon_fuzzer.cpp b/test/fuzztest/memory/forceshrinkanon_fuzzer/forceshrinkanon_fuzzer.cpp index be31580bbf13d84901d47bdd92ea93ce7666f5ad..702e15710acb59d145afc0ab082afc7440cdc414 100644 --- a/test/fuzztest/memory/forceshrinkanon_fuzzer/forceshrinkanon_fuzzer.cpp +++ b/test/fuzztest/memory/forceshrinkanon_fuzzer/forceshrinkanon_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/include/memorycommon.h b/test/fuzztest/memory/include/memorycommon.h index 3e973620baa382eb468b5c7abff495c4918c7a38..fb1b058fa1503970cf6e635edf37a604cb7d8807 100644 --- a/test/fuzztest/memory/include/memorycommon.h +++ b/test/fuzztest/memory/include/memorycommon.h @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/maxskipinterval_fuzzer/maxskipinterval_fuzzer.cpp b/test/fuzztest/memory/maxskipinterval_fuzzer/maxskipinterval_fuzzer.cpp index 26be6cb71b8482c781e8fd7d12ed5bc1f029fdee..102115840e7b4a997a6d3afb8784bb772edc2bca 100644 --- a/test/fuzztest/memory/maxskipinterval_fuzzer/maxskipinterval_fuzzer.cpp +++ b/test/fuzztest/memory/maxskipinterval_fuzzer/maxskipinterval_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/name_fuzzer/name_fuzzer.cpp b/test/fuzztest/memory/name_fuzzer/name_fuzzer.cpp index 1d1316093b550f5d6c21ece1189b262b5f6ea2eb..4d27d845c0e7ecd6203115e128e73d409e21d401 100644 --- a/test/fuzztest/memory/name_fuzzer/name_fuzzer.cpp +++ b/test/fuzztest/memory/name_fuzzer/name_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/src/memorycommon.cpp b/test/fuzztest/memory/src/memorycommon.cpp index dc7b9b451a4029ef34bdceb727004421db993d3b..0b41a6c404e8ae0fce720e55b4ee75c79e3f8110 100644 --- a/test/fuzztest/memory/src/memorycommon.cpp +++ b/test/fuzztest/memory/src/memorycommon.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/ubufs2zramratio_fuzzer/ubufs2zramratio_fuzzer.cpp b/test/fuzztest/memory/ubufs2zramratio_fuzzer/ubufs2zramratio_fuzzer.cpp index de872c2a2cf24993ad2ee1aaf9f2f4f10784d8be..e890c18e5a68d2b1e32dd4bf21639c2f264176f2 100644 --- a/test/fuzztest/memory/ubufs2zramratio_fuzzer/ubufs2zramratio_fuzzer.cpp +++ b/test/fuzztest/memory/ubufs2zramratio_fuzzer/ubufs2zramratio_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/zramcriticalthreshold_fuzzer/zramcriticalthreshold_fuzzer.cpp b/test/fuzztest/memory/zramcriticalthreshold_fuzzer/zramcriticalthreshold_fuzzer.cpp index 11df9e1751534ab61bfdae2715ca00303ed843b4..5e1f1912073bda009e6dd48a6263b744eb1f9930 100644 --- a/test/fuzztest/memory/zramcriticalthreshold_fuzzer/zramcriticalthreshold_fuzzer.cpp +++ b/test/fuzztest/memory/zramcriticalthreshold_fuzzer/zramcriticalthreshold_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/zramwmratio_fuzzer/zramwmratio_fuzzer.cpp b/test/fuzztest/memory/zramwmratio_fuzzer/zramwmratio_fuzzer.cpp index daae4a784320c9f77a1f07a8142a2a75ea8896d2..829577e4f2f0b308d40241d95d85b2e5f748b5ac 100644 --- a/test/fuzztest/memory/zramwmratio_fuzzer/zramwmratio_fuzzer.cpp +++ b/test/fuzztest/memory/zramwmratio_fuzzer/zramwmratio_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/zswapdmaxreclaimsize_fuzzer/zswapdmaxreclaimsize_fuzzer.cpp b/test/fuzztest/memory/zswapdmaxreclaimsize_fuzzer/zswapdmaxreclaimsize_fuzzer.cpp index 00f6c7919ac6d77110905b06c4106ea040c941d9..eea2664604379e01068638cc4bbfe7dd62a52741 100644 --- a/test/fuzztest/memory/zswapdmaxreclaimsize_fuzzer/zswapdmaxreclaimsize_fuzzer.cpp +++ b/test/fuzztest/memory/zswapdmaxreclaimsize_fuzzer/zswapdmaxreclaimsize_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/zswapdmemcgsparam_fuzzer/zswapdmemcgsparam_fuzzer.cpp b/test/fuzztest/memory/zswapdmemcgsparam_fuzzer/zswapdmemcgsparam_fuzzer.cpp index 6838b0708069a618f273d1aac3ac8e15740dc329..b30149c80f839d6fcaf338e991391721b07bc758 100644 --- a/test/fuzztest/memory/zswapdmemcgsparam_fuzzer/zswapdmemcgsparam_fuzzer.cpp +++ b/test/fuzztest/memory/zswapdmemcgsparam_fuzzer/zswapdmemcgsparam_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/zswapdpressureshow_fuzzer/zswapdpressureshow_fuzzer.cpp b/test/fuzztest/memory/zswapdpressureshow_fuzzer/zswapdpressureshow_fuzzer.cpp index 4ec816cfe0a104ae80b6673eee2753e5faefb9d8..32ec0b879f9ba67151fcf1709585c4e32465dbc4 100644 --- a/test/fuzztest/memory/zswapdpressureshow_fuzzer/zswapdpressureshow_fuzzer.cpp +++ b/test/fuzztest/memory/zswapdpressureshow_fuzzer/zswapdpressureshow_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/memory/zswapdsinglememcgparam_fuzzer/zswapdsinglememcgparam_fuzzer.cpp b/test/fuzztest/memory/zswapdsinglememcgparam_fuzzer/zswapdsinglememcgparam_fuzzer.cpp index 9d1605b32fffe730dfd7996a1f5ea4a8d75c050c..b901d925a1fb1d8fc970a10100d5b21bf9d3f9d3 100644 --- a/test/fuzztest/memory/zswapdsinglememcgparam_fuzzer/zswapdsinglememcgparam_fuzzer.cpp +++ b/test/fuzztest/memory/zswapdsinglememcgparam_fuzzer/zswapdsinglememcgparam_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/sched/addthreadtortg_fuzzer/addthreadtortg_fuzzer.cpp b/test/fuzztest/sched/addthreadtortg_fuzzer/addthreadtortg_fuzzer.cpp index b63a74367a8a90b775152cc918b7304dcd9a07eb..ac27a49cc524efd1853853b0f9cc60ec4ac1b180 100644 --- a/test/fuzztest/sched/addthreadtortg_fuzzer/addthreadtortg_fuzzer.cpp +++ b/test/fuzztest/sched/addthreadtortg_fuzzer/addthreadtortg_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/sched/beginframefreq_fuzzer/beginframefreq_fuzzer.cpp b/test/fuzztest/sched/beginframefreq_fuzzer/beginframefreq_fuzzer.cpp index 79c5de159e269885877fee882540dc4c93a73956..241641f7897f9b7c0131731f016f16380b478c05 100644 --- a/test/fuzztest/sched/beginframefreq_fuzzer/beginframefreq_fuzzer.cpp +++ b/test/fuzztest/sched/beginframefreq_fuzzer/beginframefreq_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/sched/endframefreq_fuzzer/endframefreq_fuzzer.cpp b/test/fuzztest/sched/endframefreq_fuzzer/endframefreq_fuzzer.cpp index ff3fece2b5ca8502446a270e81421408af5a6756..345609bb4f5e4084b8fc465656cee3aee1422464 100644 --- a/test/fuzztest/sched/endframefreq_fuzzer/endframefreq_fuzzer.cpp +++ b/test/fuzztest/sched/endframefreq_fuzzer/endframefreq_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/sched/endscene_fuzzer/endscene_fuzzer.cpp b/test/fuzztest/sched/endscene_fuzzer/endscene_fuzzer.cpp index 37bd01782a4758dd2c54c2abfc280d0331afe1cb..26de10172c185ad30e46b6b5c21a640ec9ba135c 100644 --- a/test/fuzztest/sched/endscene_fuzzer/endscene_fuzzer.cpp +++ b/test/fuzztest/sched/endscene_fuzzer/endscene_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/sched/searchrtgfortid_fuzzer/searchrtgfortid_fuzzer.cpp b/test/fuzztest/sched/searchrtgfortid_fuzzer/searchrtgfortid_fuzzer.cpp index 586dceef848fd432d494f43794a19ad4db7aa1fb..4a737b9ffbdb1f80ca7da6b3925260f4d1cf1416 100644 --- a/test/fuzztest/sched/searchrtgfortid_fuzzer/searchrtgfortid_fuzzer.cpp +++ b/test/fuzztest/sched/searchrtgfortid_fuzzer/searchrtgfortid_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/fuzztest/sched/setmargin_fuzzer/setmargin_fuzzer.cpp b/test/fuzztest/sched/setmargin_fuzzer/setmargin_fuzzer.cpp index f88cd2e815342b08071190db49593d58a92cc1de..c90741e26dba21eb43d8061cd80d605798b4bb17 100644 --- a/test/fuzztest/sched/setmargin_fuzzer/setmargin_fuzzer.cpp +++ b/test/fuzztest/sched/setmargin_fuzzer/setmargin_fuzzer.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/init_runtest.sh b/test/init_runtest.sh index 3cb5a4413700b134811d6c2cb9b3507782ef5056..2407fd6070ddedde9b047bf9c9c02867ad545bc1 100755 --- a/test/init_runtest.sh +++ b/test/init_runtest.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/kernel_ltp/generate_config.sh b/test/kernel_ltp/generate_config.sh index 63cfb852b076a7144ff206e5186e909fb4dbd094..5afc1dd52cb2a22273bb18810eabb615eb8472a3 100755 --- a/test/kernel_ltp/generate_config.sh +++ b/test/kernel_ltp/generate_config.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation01.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation01.sh index f2702e015bb7803a0323b2e1ac3f6fd5ccd1e724..902667bc1393e9eeb241daa9911ec6da7f95aea6 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation01.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation01.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation02.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation02.sh index 3ba3e7ca16732c5e85d23cfa9d42d72158e94b2f..bfa74f95177ac095992fb7c776d4907d3a632909 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation02.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation02.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation03.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation03.sh index 106438c33bd606e7ccd70f05489c6f352adec430..e61409d81170c5dcbc02bd79ac3eec8c3906cbef 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation03.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation03.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation04.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation04.sh index 5aa498372ea8b693972bd267ae0e2d5bd72f177a..39e846a34158cef5a0efddf315396e5a2379d08f 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation04.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation04.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation05.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation05.sh index ff7914d748d3c635637ae25837d05d66a815a697..f32fd70eef1d9e94513fc62522da12ae6d25b642 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation05.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation05.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation06.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation06.sh index 1e798740646e62f7026c83478d67197e55c467a0..8e68bf9723acb7cef2f12213c9ce4ae5256138c9 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation06.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation06.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation07.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation07.sh index 39775843e713ed40549c18fced754b7043a2df7f..1408f2df00613fd33b9aac811ed9abaeedd36b18 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation07.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation07.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation08.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation08.sh index 7a6cc8da69d74ff7f197eaac191a9656fc53c18f..e3733f3ba51858a38f348b4cb6e3630fd2e7ec7d 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation08.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation08.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation09.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation09.sh index 19d3129f1d35fd53bdf2ef1a99f4782d9db284a4..3918da186fbcc304b4098c0ab8e39a1f68be5da9 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation09.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation09.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/create_process.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/create_process.sh index 461699aa629e314f54c156dec72ef0b488a44bcb..ec318c71dc82fc2eb8d7aaeeb944eaa65c095bec 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/create_process.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/create_process.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug01.sh b/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug01.sh index f2be9bb51c1878fabfe0255d596671a867178876..4cbdca9ec42edfbef0f04cf2e28e07d5286665c7 100644 --- a/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug01.sh +++ b/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug01.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug02.sh b/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug02.sh index b6b1ccd86306c4baf0e5478815c527f793efb789..908c0b85dd6d9f6b498741fc767b89ad28ca0070 100644 --- a/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug02.sh +++ b/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug02.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug03.sh b/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug03.sh index 8757bb5cce1e45cd37e51cbc2c5d45dd9b9590be..728b7438cb2d9a450df45cb7e49d41da894838ea 100644 --- a/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug03.sh +++ b/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug03.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug04.sh b/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug04.sh index c6f2b83e42eb6788c1183088aaabd83b51462be8..5d13780d92b0f2444995f7c1aebaf4c899d8870c 100644 --- a/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug04.sh +++ b/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/cpusetdecouple_cpuhotplug04.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs01.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs01.sh index a8f7adc2fb39a430d8388f7675d370beb750b50a..1a32333d420e0e2fe9a6d13ded0058cfa1fe6ec5 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs01.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs01.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -38,8 +35,15 @@ do_test() local ret=0 tst_res TINFO "Start test discard size >= 512 blocks in life mode." + undiscard_num=$(cat /proc/fs/f2fs/${DISK_NAME}/undiscard_info |tr -cd "[0-9]") + if [ "$undiscard_num" != "" ] ;then + tst_res TPASS "Get undiscard info successfully, number is ${undiscard_num}." + else + tst_res TFAIL "Get undiscard info failed." + ret=$(( $ret + 1 )) + fi cat /sys/kernel/debug/tracing/trace_pipe | grep issue_discard >> log01.txt & - mkdir /mnt/f2fs_mount/test1 + mkdir $DISK_PATH/test1 if [ $? -eq 0 ]; then tst_res TPASS "Created test1 dir successfully." else @@ -49,10 +53,10 @@ do_test() local i=0 while [ $i -lt 30 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test1/image$i bs=8M count=1 + dd if=/dev/zero of=$DISK_PATH/test1/image$i bs=8M count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test1/image*[1,3,5,7,9] + echo "y" | rm $DISK_PATH/test1/image*[1,3,5,7,9] if [ $? -eq 0 ]; then tst_res TPASS "Deleted successfully." else @@ -65,9 +69,9 @@ do_test() local blklen=$(cat log01.txt | awk 'NR == 1' | awk -F '0x' '{print$3}') if [ $((16#$blklen)) -ge 512 ]; then - tst_res TPASS "blklen >= 512 successfully." + tst_res TPASS "blklen = $blklen >= 512 successfully." else - tst_res TFAIL "blklen >= 512 failed." + tst_res TFAIL "blklen = $blklen >= 512 failed." ret=$(( $ret + 1 )) fi @@ -80,9 +84,8 @@ do_test() do_clean() { - rm log01.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + echo "y" | rm $DISK_PATH/test1/* + rmdir $DISK_PATH/test1/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs02.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs02.sh index 0afcdd85e005bdee3e2499ffe06880a42f5a6ce4..02a3aa7c6594903de0438750aeb59e4e77191d3f 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs02.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs02.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -44,7 +41,7 @@ do_test() cat /sys/kernel/debug/tracing/trace_pipe | grep issue_discard >> log02.txt & sh run_fio.sh > run_fio.txt & sleep 60 - mkdir /mnt/f2fs_mount/test2 + mkdir $DISK_PATH/test2 if [ $? -eq 0 ]; then tst_res TPASS "Created test2 dir successfully." else @@ -55,10 +52,10 @@ do_test() local i=0 while [ $i -lt 30 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test2/image$i bs=8M count=1 + dd if=/dev/zero of=$DISK_PATH/test2/image$i bs=8M count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test2/image*[1,3,5,7,9] + echo "y" | rm $DISK_PATH/test2/image*[1,3,5,7,9] if [ $? -eq 0 ]; then tst_res TPASS "Deleted successfully." else @@ -70,7 +67,7 @@ do_test() local second=$(wc -l log02.txt | awk -F ' ' '{print$1}') sleep 90 kill %1 - + sleep 5 local err=$(cat run_fio.txt | grep err | awk -F ':' '{print$3}' | tr -cd "[0-9]") if [ $err -eq 0 ]; then tst_res TPASS "fio read successfully." @@ -81,18 +78,12 @@ do_test() local blklen=$(cat log02.txt | awk 'NR == 1' | awk -F '0x' '{print$3}') if [ $((16#$blklen)) -ge 512 ]; then - tst_res TPASS "blklen >= 512 successfully." + tst_res TPASS "blklen = $blklen >= 512 successfully." else - tst_res TFAIL "blklen >= 512 failed." + tst_res TFAIL "blklen = $blklen >= 512 failed." ret=$(( $ret + 1 )) fi - if [ $(( $second - $first )) -gt 0 ]; then - tst_res TPASS "IO perception test successfully." - else - tst_res TFAIL "IO perception test failed." - ret=$(( $ret + 1 )) - fi if [ $ret -eq 0 ];then tst_res TPASS "life mode, discard is greater than or equal to 512 block \ @@ -105,9 +96,9 @@ do_test() do_clean() { - rm -rf log02.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + echo "y" | rm $DISK_PATH/test2/* + rmdir $DISK_PATH/test2/ + echo "y" | rm log02.txt } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs03.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs03.sh index 4b1f50f9487d4cd825b735bb10be712257ec4a02..f698712a898921c6544779a308775cc5d12f8f47 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs03.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs03.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -41,7 +38,7 @@ do_test() cat /sys/kernel/debug/tracing/trace_pipe | grep issue_discard >> log03.txt & sleep 60 - mkdir /mnt/f2fs_mount/test3 + mkdir $DISK_PATH/test3 if [ $? -eq 0 ]; then tst_res TPASS "Creation test3 dir successfully." else @@ -52,10 +49,10 @@ do_test() local i=0 while [ $i -lt 50 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test3/image$i bs=512K count=1 + dd if=/dev/zero of=$DISK_PATH/test3/image$i bs=512K count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test3/image*[1,3,5,7,9] + echo "y" | rm $DISK_PATH/test3/image*[1,3,5,7,9] if [ $? -eq 0 ]; then tst_res TPASS "Deleted successfully." else @@ -68,9 +65,9 @@ do_test() local blklen=$(cat log03.txt | awk 'NR == 1' | awk -F '0x' '{print$3}') if [ $((16#$blklen)) -ge 16 ];then - tst_res TPASS "blklen >= 16 successfully." + tst_res TPASS "blklen = $blklen >= 16 successfully." else - tst_res TFAIL "Log printing fail." + tst_res TFAIL "blklen = $blklen >= 16 fail." ret=$(( $ret + 1 )) fi @@ -85,9 +82,10 @@ do_test() do_clean() { - rm -rf log03.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + echo "y" | rm $DISK_PATH/test3/* + rmdir $DISK_PATH/test3/ + echo "y" | rm $DISK_PATH/f2fs_test/* + rmdir $DISK_PATH/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs05.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs05.sh index 3a5f78862b1c814dac38decf002b90c6802a849c..0de0cdf244d699686c58bc202ee31192567824d4 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs05.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs05.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -30,7 +27,7 @@ source performance_init.sh do_setup() { - + } do_test() @@ -40,7 +37,7 @@ do_test() tst_res TINFO "Start test discard size >= 1 block in performance mode." cat /sys/kernel/debug/tracing/trace_pipe | grep issue_discard >> log05.txt & - mkdir /mnt/f2fs_mount/test5 + mkdir $DISK_PATH/test5 if [ $? -eq 0 ]; then tst_res TPASS "Creation test5 dir successfully." else @@ -50,10 +47,10 @@ do_test() local i=0 while [ $i -lt 200 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test5/image$i bs=4k count=1 + dd if=/dev/zero of=$DISK_PATH/test5/image$i bs=4k count=1 i=$((i+1)) done - rm -rf /mnt/f2fs_mount/test5/image*[1,3,5,7,9] + echo "y" | rm $DISK_PATH/test5/image*[1,3,5,7,9] if [ $? -eq 0 ]; then tst_res TPASS "Delete successfully." else @@ -65,9 +62,9 @@ do_test() kill %1 local blklen=$(cat log05.txt | awk 'NR == 1' | awk -F '0x' '{print$3}') if [ $((16#$blklen)) -ge 1 ];then - tst_res TPASS "Log printing successfully." + tst_res TPASS "blklen = $blklen >= 1 successfully." else - tst_res TFAIL "Log printing failed." + tst_res TFAIL "blklen = $blklen >= 1 failed." ret=$(( $ret + 1 )) fi @@ -82,9 +79,10 @@ do_test() do_clean() { - rm -rf log05.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + echo "y" | rm $DISK_PATH/test5/* + rmdir $DISK_PATH/test5/ + echo "y" | rm $DISK_PATH/f2fs_test/* + rmdir $DISK_PATH/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs07.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs07.sh index a749a3f0e8bf7b3081c70d20e5d4998d3c3f68cb..e96a80d05966ead852c5188eb2a789d087bc01ea 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs07.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs07.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,22 +25,20 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + } do_test() { local ret=0 - _ssr_path=/sys/fs/f2fs/loop1 + _ssr_path=/sys/fs/f2fs/${DISK_NAME} tst_res TINFO "Start test hierarchical SSR control interface." if [ $(cat $_ssr_path/hc_enable) == '0' ]; then - tst_res TPASS "default is 0 successfully." + tst_res TPASS "$_ssr_path default is 0 successfully." else - tst_res TFAIL "default not is 0 failed." + tst_res TFAIL "$_ssr_path default not is 0 failed." ret=$(( $ret + 1 )) fi @@ -59,8 +54,6 @@ do_test() do_clean() { echo $temp > $_ssr_path/hc_enable - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs08.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs08.sh index 77a2946e3c97a777fa559767fb331f602ab19adc..894ae22b8c12c444a13f233a6aa631bb306f3a63 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs08.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs08.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,15 +25,13 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + } do_test() { ret=0 - _ssr_path=/sys/fs/f2fs/loop1 + _ssr_path=/sys/fs/f2fs/${DISK_NAME} tst_res TINFO "Start test hierarchical SSR threshold configuration interface." @@ -73,7 +68,7 @@ do_test() confirm_value() { - local result_out1=$(cat /sys/fs/f2fs/loop1/$1) + local result_out1=$(cat /sys/fs/f2fs/${DISK_NAME}/$1) if [ "$result_out1" == "5242880" ]; then tst_res TPASS "$1 is 5242880 expected." return 0 @@ -85,7 +80,7 @@ confirm_value() confirm_change_value() { - local result_out2=$(cat /sys/fs/f2fs/loop1/$1) + local result_out2=$(cat /sys/fs/f2fs/${DISK_NAME}/$1) if [ "$result_out2" == "6000000" ]; then tst_res TPASS "$1 is 6000000 expected." else @@ -100,8 +95,6 @@ do_clean() echo $init_value2 > $_ssr_path/hc_warm_data_lower_limit echo $init_value3 > $_ssr_path/hc_hot_node_lower_limit echo $init_value4 > $_ssr_path/hc_warm_node_lower_limit - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs09.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs09.sh index 87007314d3c86e9f578024cf902bb52475fd8b35..672c85290c8534c095e31ded1c6d71285a945810 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs09.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs09.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,15 +25,13 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + } do_test() { ret=0 - _ssr_path=/sys/fs/f2fs/loop1 + _ssr_path=/sys/fs/f2fs/${DISK_NAME} tst_res TINFO "Start test hierarchical SSR waterline configuration interface." @@ -99,8 +94,7 @@ do_clean() echo $init_value2 > $_ssr_path/hc_warm_data_waterline echo $init_value3 > $_ssr_path/hc_hot_node_waterline echo $init_value4 > $_ssr_path/hc_warm_node_waterline - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs10.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs10.sh index ebafc0f3410096bf208d567fcbd20d9020877c5c..b5dea9e9178a5d604c07d9db3da03df36dd635d1 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs10.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs10.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,9 +25,7 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir $DISK_PATH/ } do_test() @@ -41,34 +36,40 @@ do_test() tst_res TINFO "Start test hierarchical SSR recovery function is enabled." local i=0 - while [ $i -lt 32 ] + df -h | grep -w "$DISK_NAME" | awk -F " " '{print $2}' > 1.txt + df -h | grep -w "$DISK_NAME" | awk -F " " '{print $3}' > 2.txt + total_mem=$(sed 's/.$//' 1.txt) + used_mem=$(sed 's/.$//' 2.txt | cut -d '.' -f1) + mid_mem=$(expr $total_mem - 2) + expected_mem=$(expr $mid_mem - $used_mem) + while [ $i -lt $expected_mem ] do - dd if=/dev/zero of=/mnt/f2fs_mount/image$i bs=512M count=1 + dd if=/dev/zero of=$DISK_PATH/image$i bs=1G count=1 i=$(( $i + 1 )) done - mkdir /mnt/f2fs_mount/test10 + mkdir $DISK_PATH/test10 local i=0 while [ $i -lt 5120 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test10/image$i bs=512k count=1 + dd if=/dev/zero of=$DISK_PATH/test10/image$i bs=512k count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test10/image*[1,3,5,7,9] + echo "y" | rm $DISK_PATH/test10/image*[1,3,5,7,9] - echo 1 > /sys/fs/f2fs/loop1/hc_enable + echo 1 > /sys/fs/f2fs/${DISK_NAME}/hc_enable echo 1 > $_sys_path/tracing_on echo 1 > $_sys_path/events/f2fs/f2fs_grading_ssr_allocate/enable cat $_sys_path/trace_pipe | grep ssr >> log10.txt & - mkdir /mnt/f2fs_mount/test10/f2fs_grading_ssr_allocate + mkdir $DISK_PATH/test10/f2fs_grading_ssr_allocate local i=0 while [ $i -lt 200 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test10/f2fs_grading_ssr_allocate/image$i bs=4k count=1 + dd if=/dev/zero of=$DISK_PATH/test10/f2fs_grading_ssr_allocate/image$i bs=4k count=1 i=$(($i + 1)) done - rm -rf /mnt/f2fs_mount/test10/f2fs_grading_ssr_allocate/image*[1,3,5,7,9] + echo "y" | rm $DISK_PATH/test10/f2fs_grading_ssr_allocate/image*[1,3,5,7,9] sleep 180 kill %1 @@ -85,13 +86,18 @@ do_test() else tst_res TFAIL "The hierarchical SSR recovery function is enabled failed!" fi + + echo "y" | rm 1.txt + echo "y" | rm 2.txt } do_clean() { - rm -rf log10.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + echo "y" | rm $DISK_PATH/test10/f2fs_grading_ssr_allocate/* + rmdir $DISK_PATH/test10/f2fs_grading_ssr_allocate/ + echo "y" | rm $DISK_PATH/test10/* + rmdir $DISK_PATH/test10/ + echo "y" | rm $DISK_PATH/image* } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs11.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs11.sh index b1bc0b9842511ba046a1aa3e623abd513eabfbb2..9e51eb71c0052ff5b83b11e68fcef8c52bb63b7f 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs11.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs11.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,9 +25,7 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir $DISK_PATH/f2fs_test } do_test() @@ -42,32 +37,32 @@ do_test() local i=0 while [ $i -lt 32 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/image$i bs=512M count=1 + dd if=/dev/zero of=$DISK_PATH/f2fs_test/image$i bs=512M count=1 i=$(( $i+ 1 )) done - mkdir /mnt/f2fs_mount/test11 + mkdir $DISK_PATH/test11 local i=0 while [ $i -lt 5120 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test11/image$i bs=512k count=1 + dd if=/dev/zero of=$DISK_PATH/test11/image$i bs=512k count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test11/image*[1,3,5,7,9] + echo "y" | rm $DISK_PATH/test11/image*[1,3,5,7,9] - echo 0 > /sys/fs/f2fs/loop1/hc_enable + echo 0 > /sys/fs/f2fs/${DISK_NAME}/hc_enable echo 1 > $_sys_path/tracing_on echo 1 > $_sys_path/events/f2fs/f2fs_grading_ssr_allocate/enable cat $_sys_path/trace_pipe | grep ssr >> log11.txt & - mkdir /mnt/f2fs_mount/test11/f2fs_grading_ssr_allocate + mkdir $DISK_PATH/test11/f2fs_grading_ssr_allocate local i=0 while [ $i -lt 200 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test11/f2fs_grading_ssr_allocate/image$i bs=4k count=1 + dd if=/dev/zero of=$DISK_PATH/test11/f2fs_grading_ssr_allocate/image$i bs=4k count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test11/f2fs_grading_ssr_allocate/image*[1,3,5,7,9] + echo "y" | rm $DISK_PATH/test11/f2fs_grading_ssr_allocate/image*[1,3,5,7,9] sleep 180 kill %1 @@ -88,9 +83,12 @@ do_test() do_clean() { - rm -rf log11.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + echo "y" | rm $DISK_PATH/test11/f2fs_grading_ssr_allocate/* + rmdir $DISK_PATH/test11/f2fs_grading_ssr_allocate/ + echo "y" | rm $DISK_PATH/test11/* + rmdir $DISK_PATH/test11/ + echo "y" | rm $DISK_PATH/f2fs_test/* + rmdir $DISK_PATH/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs12.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs12.sh index aaca37e176f0288b66ffaef824b47e3e1fedfed7..8630586c68e03710e18a8f08b5c6f7b3fc620faf 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs12.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs12.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,16 +25,14 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir $DISK_PATH/f2fs_test } do_test() { local ret=0 local _sys_path=/sys/kernel/debug/tracing - temp=$(cat /sys/fs/f2fs/loop1/gc_urgent) + temp=$(cat /sys/fs/f2fs/${DISK_NAME}/gc_urgent) tst_res TINFO "Start test GC function." @@ -48,12 +43,12 @@ do_test() local i=0 while [ $i -lt 512 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/image$i bs=1M count=1 + dd if=/dev/zero of=$DISK_PATH/f2fs_test/image$i bs=1M count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/image*[1,3,5,7,9] + echo "y" | rm $DISK_PATH/f2fs_test/image*[1,3,5,7,9] - echo 1 > /sys/fs/f2fs/loop1/gc_urgent + echo 1 > /sys/fs/f2fs/${DISK_NAME}/gc_urgent sleep 60 kill %1 @@ -72,11 +67,10 @@ do_test() } do_clean() -{ - rm -rf log12.txt - echo $temp > /sys/fs/f2fs/loop1/gc_urgent - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount +{ + echo $temp > /sys/fs/f2fs/${DISK_NAME}/gc_urgent + echo "y" | rm $DISK_PATH/f2fs_test/* + rmdir $DISK_PATH/f2fs_test } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/equilibrium_init.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/equilibrium_init.sh index 0ce081adad53be1e9910b5da4519963ce7756a9a..6b50ec8ae42e65ac223714ba37bc3281b4412657 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/equilibrium_init.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/equilibrium_init.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,9 +25,7 @@ source tst_oh.sh state_init() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir $DISK_PATH/f2fs_test } equilibrium_init() @@ -42,9 +37,13 @@ equilibrium_init() local a=$(cat $segs_path | grep segs | awk -F ' ' '{print$3}') local i=0 - while [ $i -lt 32 ] + df -h | grep -w "$DISK_NAME" | awk -F " " '{print $2}' > 1.txt + total_mem=$(sed 's/.$//' 1.txt) + mid_mem=$(expr $total_mem \* 82) + expected_mem=$(expr $mid_mem / 100) + while [ $i -lt $expected_mem ] do - dd if=/dev/zero of=/mnt/f2fs_mount/image$i bs=512M count=1 + dd if=/dev/zero of=$DISK_PATH/f2fs_test/image$i bs=1G count=1 i=$(( $i + 1 )) done @@ -64,7 +63,7 @@ equilibrium_init() fi sleep 60 - if [ $(cat /sys/fs/f2fs/loop1/discard_type) == '1' ];then + if [ $(cat /sys/fs/f2fs/${DISK_NAME}/discard_type) == '1' ];then tst_res TPASS "equilibrium model successfully." else tst_res TFAIL "equilibrium model failed." @@ -85,6 +84,8 @@ equilibrium_init() else tst_res TFAIL "equilibrium_init failed!" fi + + echo "y" | rm 1.txt } state_init diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/life_init.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/life_init.sh index 1e407bda3680e16ea7116c602f2b94160c3b8fdf..30757a222b9be6a560f79c900700c9ccce769e03 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/life_init.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/life_init.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,9 +25,7 @@ source tst_oh.sh state_init() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + } life_init() @@ -54,7 +49,7 @@ life_init() ret=$(( $ret + 1 )) fi - if [ $(cat /sys/fs/f2fs/loop1/discard_type) == '0' ];then + if [ $(cat /sys/fs/f2fs/${DISK_NAME}/discard_type) == '0' ];then tst_res TPASS "life model successfully." else tst_res TFAIL "life model failed." diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/performance_init.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/performance_init.sh index b38e723787ce356045de419f8439891513c15ee9..f7bfb3050c3c65601dcff21ded0d313091ad39fb 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/performance_init.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/performance_init.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,9 +25,7 @@ source tst_oh.sh state_init() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir $DISK_PATH/f2fs_test } performance_init() @@ -42,9 +37,13 @@ performance_init() local a=$(cat $segs_path | grep segs | awk -F ' ' '{print$3}') echo "start Embedded file system $(date +%Y%m%d%H%M%S)...." >> log06.txt local i=0 - while [ $i -lt 37 ] + df -h | grep -w "$DISK_NAME" | awk -F " " '{print $2}' > 1.txt + total_mem=$(sed 's/.$//' 1.txt) + mid_mem=$(expr $total_mem \* 90) + expected_mem=$(expr $mid_mem / 100) + while [ $i -lt $expected_mem ] do - dd if=/dev/zero of=/mnt/f2fs_mount/image$i bs=512M count=1 + dd if=/dev/zero of=$DISK_PATH/f2fs_test/image$i bs=1G count=1 i=$(( $i + 1 )) done echo "end Embedded file system $(date +%Y%m%d%H%M%S)...." >> log06.txt @@ -61,7 +60,7 @@ performance_init() fi sleep 60 - if [ $(cat /sys/fs/f2fs/loop1/discard_type) == '2' ];then + if [ $(cat /sys/fs/f2fs/${DISK_NAME}/discard_type) == '2' ];then tst_res TPASS "performance model successfully." else tst_res TFAIL "performance model failed." @@ -81,6 +80,8 @@ performance_init() else tst_res TFAIL "performance_init failed!" fi + + echo "y" | rm 1.txt } state_init diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/run_fio.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/run_fio.sh index 38b7e6c252d5ee73f39e710be2c2dca086910372..f517b39036a1e6abb4ad1749184a19848cd3b7d6 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/run_fio.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/run_fio.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,10 +22,11 @@ ################################################################################ run_fio() -{ - ./fio --name=rw_bg --numjobs=1 --filename=/mnt/f2fs_mount/fio-test.file \ - --bs=32768K --rw=read --ioengine=psync --refill_buffers --group_reporting \ - --runtime=360 --time_based --filesize=128M +{ + mkdir $DISK_PATH/f2fs_test + ./fio --name=rw_bg --numjobs=1 --filename=$DISK_PATH/f2fs_test/fio-test.file \ + --bs=32768K --rw=read --ioengine=sync --refill_buffers --group_reporting \ + --runtime=360 --time_based --filesize=128M } run_fio \ No newline at end of file diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t_init.sh b/test/moduletest/runtest/bin/enhancedf2fs_t_init.sh index 5a6f483233bd5088c1c49012162e9d655b9766c4..9174a76cd55a495069760682baccca1e84e8bc45 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t_init.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t_init.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,19 +20,33 @@ # History: April 8 2022 - init scripts # ################################################################################ -export IMG_FILE=/data/image_f2fs create_catalogue() { - mkdir /mnt/f2fs_mount/ + export DISK_PATH=$(mount | grep f2fs | cut -F 3) + export DISK_NAME=$(df -h |grep /dev/block |grep $DISK_PATH |awk '{print $1}' |cut -d "/" -f4) +} + +test_remount() +{ + gc_merge_mount_opt=$(mount |grep gc_merge) + if [[ "$gc_merge_mount_opt" == "" ]] ;then + mount -o remount,gc_merge $DISK_PATH/ + mount -o remount,nogc_merge $DISK_PATH/ + else + mount -o remount,nogc_merge $DISK_PATH/ + mount -o remount,gc_merge $DISK_PATH/ + fi + mount -o remount,rw $DISK_PATH/ } enable_init() { - dd if=/dev/zero of=$IMG_FILE bs=1M count=20480 + } echo "***************************ENHANCED INIT START***************************" create_catalogue +test_remount enable_init echo "***************************ENHANCED INIT END*****************************" diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t_uninit.sh b/test/moduletest/runtest/bin/enhancedf2fs_t_uninit.sh index fda31b5a1bb901d7457fa7a0e4abf2016264b5d8..c4d77df201a6e1b0cd0a97b377b1f14eb5cb81d2 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t_uninit.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t_uninit.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,8 +23,7 @@ delete_catalogue() { - rm /mnt/f2fs_mount/* - rmdir /mnt/f2fs_mount + } echo "***************************enhanced UNINIT START**************************" diff --git a/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap01.sh b/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap01.sh index 388c952e65585b4fb75a2f9f944d6aa1107c1a5f..249f08f607da785cfe35e284bbc727cd7fe8b912 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap01.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap01.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap02.sh b/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap02.sh index bf122bd334b2269b8799291a6db7f4829cdf492e..377961b4c70b5b6bb0ce607ffb746c8bc9f4c888 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap02.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap02.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap03.sh b/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap03.sh index 75bc11d64457ce53ce5ae10fa3fa2142742b4a04..1bd795ed02a0b534f6c9ca599e8957ee1bdf714f 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap03.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap03.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap04.sh b/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap04.sh index 8562f96690e2e66a4845d3284dd9dfa5bdb3bcf6..91842549935679c8f0785c9c6a43788bb281f0af 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap04.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap04.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap05.sh b/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap05.sh index 6a3ac9b7f50feb8ff8045711fa9b271b0b947861..2a3fd47e3e92fd923497e4a875bd946885441e42 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap05.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t/testcases/bin/enhancedswap05.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/enhancedswap_t_init.sh b/test/moduletest/runtest/bin/enhancedswap_t_init.sh index 6bf7e18be4c8063bf569c40e41379bcbe9028fc7..2b7ac7094144d6099376f8afa1fd82da1c790dc0 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t_init.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t_init.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh b/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh index a49b92388814524949329201c24501e65c9f3032..c36abbed70d76acaaf9d17f88fca35226d2e5049 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug01.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug01.sh index 6a3b8726cf3a74aa415d593a5dd4988493070bbe..f76af0ba15290b3678c286d06786ab6951b2c087 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug01.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug01.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug02.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug02.sh index 8ba7096a754374f92c7e9df936f0cb99ab79a998..377a66d0522609c253e7f55c14562ce43cdc8c32 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug02.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug02.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug03.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug03.sh index aa5cf0d7f13eb69d323eaa650b5339019c9a513f..cbcea7e6d339909f41354f7bf5f05bf119b352cc 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug03.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug03.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh index 06f61640a69402697ad122f33515278b99f21315..911d1b130c83f0f9f25eaf65145c3d304686a4d1 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug05.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug05.sh index bf84468efe1eff96cc65fe5295897d05704adc44..9949cc931897e77bd5acecf4a06d7e2fb85ca538 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug05.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug05.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug06.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug06.sh index fbf84c6c6c40f6e84596cc3f3257d4a10fb04d3b..f245cdb627067d80510b6aa46e664271411685f6 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug06.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug06.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug07.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug07.sh index a09d4485547b8ca889910e40072ce2ac3c5b4606..8e3025ba14ca7525483c76cf4c025784665a915d 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug07.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug07.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug08.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug08.sh index c4ee052b6967d1ce0b3c0127fa3ca0a16a489979..ff4826b408b01a6034db5e8723ecdc9521f13132 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug08.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug08.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug09.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug09.sh index b1720a4ec585842afa22065a0e5d2186f5451139..9af4be4b56ce9b2e73870d15ae09343dabce75cd 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug09.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug09.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug10.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug10.sh index d43e358e2d1f78af2ec331ddff22abd605b3224a..c3e1d631592892a4a7b180e4751913f20e49e792 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug10.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug10.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t_init.sh b/test/moduletest/runtest/bin/mem_debug_t_init.sh index 216287037a3d8f84a347158fe48e5b79483420e3..f3a57b05495c4feab8dd79052cdd5a06893d1abf 100644 --- a/test/moduletest/runtest/bin/mem_debug_t_init.sh +++ b/test/moduletest/runtest/bin/mem_debug_t_init.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/mem_debug_t_uninit.sh b/test/moduletest/runtest/bin/mem_debug_t_uninit.sh index ec9bbc5bf6cbfea39d50d1235c27164f7bcec35f..90b338aa83c68714452da405bb7db1dfaf68b693 100644 --- a/test/moduletest/runtest/bin/mem_debug_t_uninit.sh +++ b/test/moduletest/runtest/bin/mem_debug_t_uninit.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/memorycontrol_t/testcases/bin/memory_control01.sh b/test/moduletest/runtest/bin/memorycontrol_t/testcases/bin/memory_control01.sh new file mode 100644 index 0000000000000000000000000000000000000000..f2614fc287e5470646b730946761ef02a7eb5a90 --- /dev/null +++ b/test/moduletest/runtest/bin/memorycontrol_t/testcases/bin/memory_control01.sh @@ -0,0 +1,51 @@ +#!/bin/sh +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: memory_control01.sh +# +# Description: Verify /dev/memcg/memory.app_score +# +# Authors: Wu Lisai - wulisai@huawei-partners.com +# +# History: Nov 18 2022 - init scripts +# +################################################################################ +source tst_oh.sh + +do_setup() +{ + zcat /proc/config.gz | grep CONFIG_HYPERHOLD_MEMCG=y || tst_res TCONF "CONFIG_HYPERHOLD_MEMCG=y not satisfied!" +} + +do_test() +{ + tst_res TINFO "Start to verify mem ." + + mem=$(cat /dev/memcg/memory.app_score) + echo $mem + if [ "$mem"x = "300"x ]; then + tst_res TPASS "memory.app_score value correct." + else + tst_res TFAIL "memory.app_score value incorrect." + fi +} + +do_clean() +{ + +} + +do_setup +do_test +do_clean +tst_exit diff --git a/test/moduletest/runtest/bin/memorycontrol_t/testcases/bin/memory_control02.sh b/test/moduletest/runtest/bin/memorycontrol_t/testcases/bin/memory_control02.sh new file mode 100644 index 0000000000000000000000000000000000000000..95ae4facfc45b54ad94014c0c32f9af58e1f077a --- /dev/null +++ b/test/moduletest/runtest/bin/memorycontrol_t/testcases/bin/memory_control02.sh @@ -0,0 +1,52 @@ +#!/bin/sh +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: memory_control02.sh +# +# Description: Verify /dev/memcg/memory.ub_ufs2zram_ratio +# +# Authors: Wu Lisai - wulisai@huawei-partners.com +# +# History: Nov 18 2022 - init scripts +# +################################################################################ +source tst_oh.sh + +do_setup() +{ + zcat /proc/config.gz | grep CONFIG_HYPERHOLD_MEMCG=y || tst_res TCONF "CONFIG_HYPERHOLD_MEMCG=y not satisfied!" +} + +do_test() +{ + tst_res TINFO "Start to verify mem ." + + mem=$(cat /dev/memcg/memory.ub_ufs2zram_ratio) + + if [ "$mem"x = "0"x ]; then + tst_res TPASS "memory_control default value correct." + else + tst_res TFAIL "memory_control default value incorrect." + fi + +} + +do_clean() +{ + +} + +do_setup +do_test +do_clean +tst_exit diff --git a/test/moduletest/runtest/bin/memorycontrol_t/testcases/bin/memory_control03.sh b/test/moduletest/runtest/bin/memorycontrol_t/testcases/bin/memory_control03.sh new file mode 100644 index 0000000000000000000000000000000000000000..41b14b1738b9fe125b08b33551d389c4f4f0d040 --- /dev/null +++ b/test/moduletest/runtest/bin/memorycontrol_t/testcases/bin/memory_control03.sh @@ -0,0 +1,52 @@ +#!/bin/sh +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: memory_control03.sh +# +# Description: Verify /dev/memcg/memory.name +# +# Authors: Wu Lisai - wulisai@huawei-partners.com +# +# History: Nov 18 2022 - init scripts +# +################################################################################ +source tst_oh.sh + +do_setup() +{ + zcat /proc/config.gz | grep CONFIG_HYPERHOLD_MEMCG=y || tst_res TCONF "CONFIG_HYPERHOLD_MEMCG=y not satisfied!" +} + +do_test() +{ + tst_res TINFO "Start to verify mem ." + + echo "test_cgroup" > /dev/memcg/memory.name + mem=$(cat /dev/memcg/memory.name) + echo $mem + if [ "$mem"x = "test_cgroup"x ]; then + tst_res TPASS "memory_control default value correct." + else + tst_res TFAIL "memory_control default value incorrect." + fi +} + +do_clean() +{ + +} + +do_setup +do_test +do_clean +tst_exit diff --git a/test/moduletest/runtest/bin/purgeable_t/testcases/bin/purgeable_mem01.sh b/test/moduletest/runtest/bin/purgeable_t/testcases/bin/purgeable_mem01.sh new file mode 100644 index 0000000000000000000000000000000000000000..376b93948e49f0644138681cbcbc2b5220cb9c37 --- /dev/null +++ b/test/moduletest/runtest/bin/purgeable_t/testcases/bin/purgeable_mem01.sh @@ -0,0 +1,65 @@ +#!/bin/sh +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. +# Do not use in new code. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: purgeable_mem01.sh +# +# Description: Static memory reservation query test +# +# Authors: Ke Liu - liuke94@huawei.com +# +# History: Nov 2 2022 - init scripts +# +################################################################################ +source tst_oh.sh + +do_setup() +{ + zcat /proc/config.gz | grep CONFIG_MEM_PURGEABLE=y || tst_res TCONF "CONFIG_MEM_PURGEABLE=y not satisfied!" +} + +do_test() +{ + local testpath=$(find / -name purgeable_cpp_test | grep -v find) + if [ ! $testpath ];then + tst_res TFAIL "can not find purgeable_cpp_test!" + fi + (cd $(echo ${testpath%purgeable_cpp_test});chmod 777 purgeable_cpp_test;./purgeable_cpp_test >mylog.log) + if [ $(grep -c -i "ok\|success\|true" ${testpath%purgeable_cpp_test}/mylog.log) -ne '0' ];then + tst_res TINFO "purgeable_cpp_test executed success." + else + tst_res TFAIL "purgeable_cpp_test executed fail!" + fi + if [ $(grep -c -i "error\|fail\|false" ${testpath%purgeable_cpp_test}/mylog.log) -ne '0' ];then + tst_res TFAIL "purgeable_cpp_test test error!" + else + tst_res TPASS "purgeable_cpp_test test pass." + fi + rm ${testpath%purgeable_cpp_test}/mylog.log + ls ${testpath%purgeable_cpp_test} >log2.log + local lastxml=$(tac log2.log | grep purgeable_cpp_test | grep xml| head -n 1) + rm ${testpath%purgeable_cpp_test}${lastxml} +} + +do_clean() +{ + rm log2.log +} + + +do_setup +do_test +do_clean +tst_exit diff --git a/test/moduletest/runtest/bin/purgeable_t/testcases/bin/purgeable_mem02.sh b/test/moduletest/runtest/bin/purgeable_t/testcases/bin/purgeable_mem02.sh new file mode 100644 index 0000000000000000000000000000000000000000..cfdcfb1d14a222d6bfa9aadc67d58e82fddc615d --- /dev/null +++ b/test/moduletest/runtest/bin/purgeable_t/testcases/bin/purgeable_mem02.sh @@ -0,0 +1,71 @@ +#!/bin/sh +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. +# Do not use in new code. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: purgeable_mem02.sh +# +# Description: Static memory reservation query test +# +# Authors: Ke Liu - liuke94@huawei.com +# +# History: Nov 2 2022 - init scripts +# +################################################################################ +source tst_oh.sh + +do_setup() +{ + zcat /proc/config.gz | grep CONFIG_MEM_PURGEABLE=y || tst_res TCONF "CONFIG_MEM_PURGEABLE=y not satisfied!" +} + +do_test() +{ + local testpath=$(find / -name purgeable_cpp_test | grep -v find) + if [ ! $testpath ];then + tst_res TFAIL "can not find purgeable_cpp_test!" + fi + (cd $(echo ${testpath%purgeable_cpp_test});chmod 777 purgeable_cpp_test;./purgeable_cpp_test &>/dev/null &) + local pid=$(pidof purgeable_cpp_test) + while [ "$pid" -eq '0' ] + do + pid=$(pidof purgeable_cpp_test) + done + while [ "$pid" -ne '0' ] + do + cat /proc/meminfo | grep -i purg | grep -v grep | grep -v Name >>mem.log + pid=$(pidof purgeable_cpp_test) + done + cat mem.log | grep -v '0 kB' >mem1.log + if [ -s mem1.log ];then + tst_res TPASS "Purgeable memory reservation query test pass." + else + tst_res TFAIL "Purgeable memory reservation query test error!" + fi + ls ${testpath%purgeable_cpp_test} >log2.log + local lastxml=$(tac log2.log | grep purgeable_cpp_test | grep xml| head -n 1) + rm ${testpath%purgeable_cpp_test}${lastxml} +} + +do_clean() +{ + rm mem.log + rm mem1.log + rm log2.log +} + +do_setup +do_test +do_clean +tst_exit diff --git a/test/moduletest/runtest/bin/purgeable_t/testcases/bin/purgeable_mem03.sh b/test/moduletest/runtest/bin/purgeable_t/testcases/bin/purgeable_mem03.sh new file mode 100644 index 0000000000000000000000000000000000000000..3ef4a694a085806c2a1e3b8c297d4347179d826c --- /dev/null +++ b/test/moduletest/runtest/bin/purgeable_t/testcases/bin/purgeable_mem03.sh @@ -0,0 +1,71 @@ +#!/bin/sh +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. +# Do not use in new code. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: purgeable_mem03.sh +# +# Description: Static memory reservation query test +# +# Authors: Ke Liu - liuke94@huawei.com +# +# History: Nov 2 2022 - init scripts +# +################################################################################ +source tst_oh.sh + +do_setup() +{ + zcat /proc/config.gz | grep CONFIG_MEM_PURGEABLE=y || tst_res TCONF "CONFIG_MEM_PURGEABLE=y not satisfied!" +} + +do_test() +{ + local testpath=$(find / -name purgeable_cpp_test | grep -v find) + if [ ! $testpath ];then + tst_res TFAIL "can not find purgeable_cpp_test!" + fi + (cd $(echo ${testpath%purgeable_cpp_test});chmod 777 purgeable_cpp_test;./purgeable_cpp_test &>/dev/null &) + local pid= $(pidof purgeable_cpp_test) + while [ "$pid" -eq '0' ] + do + pid=$(pidof purgeable_cpp_test) + done + while [ "$pid" -ne '0' ] + do + cat /proc/${pid}/status | grep -i purg | grep -v grep | grep -v Name >>mem.log + pid=$(pidof purgeable_cpp_test) + done + cat mem.log | grep -v '0 kB' >mem1.log + if [ -s mem1.log ];then + tst_res TPASS "Purgeable memory reservation query test pass." + else + tst_res TFAIL "Purgeable memory reservation query test error!" + fi + ls ${testpath%purgeable_cpp_test} >log2.log + local lastxml=$(tac log2.log | grep purgeable_cpp_test | grep xml| head -n 1) + rm ${testpath%purgeable_cpp_test}${lastxml} +} + +do_clean() +{ + rm mem.log + rm mem1.log + rm log2.log +} + +do_setup +do_test +do_clean +tst_exit diff --git a/test/moduletest/runtest/bin/rss_monitor_t/testcases/bin/rss_monitor01.sh b/test/moduletest/runtest/bin/rss_monitor_t/testcases/bin/rss_monitor01.sh new file mode 100644 index 0000000000000000000000000000000000000000..a26b11b8a1d9a3a4c9f439c24bed29a686bb04b5 --- /dev/null +++ b/test/moduletest/runtest/bin/rss_monitor_t/testcases/bin/rss_monitor01.sh @@ -0,0 +1,60 @@ +#!/bin/sh +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: rss_monitor01.sh +# +# Description: Verify /proc/pid/rss take effect +# +# Authors: Liu Ke - liuke94@huawei.com +# +# History: Sep 20 2022 - init scripts +# +################################################################################ +source tst_oh.sh + +do_setup() +{ + zcat /proc/config.gz | grep CONFIG_RSS_THRESHOLD=y || tst_res TCONF "CONFIG_RSS_THRESHOLD=y not satisfied!" +} + +do_test() +{ + local ret=0 + + tst_res TINFO "Start to verify rss ." + flag=0 + while (($flag < 1)) + do + pid=$(ps -ef | grep com.ohos.systemui | awk 'NR==1 {print $2}') + rss=$(cat /proc/$pid/rss | awk -F ':' '{print$2}'| awk '{print$1}') + statusVMRss=$(cat /proc/$pid/status | grep VmRSS | awk -F ':' '{print$2}' | awk '{print$1}') + if [ "$rss"x = "$statusVMRss"x ]; then + tst_res TPASS "rss info correct." + flag=1 + else + flag=0 + fi + done + + +} + +do_clean() +{ + +} + +do_setup +do_test +do_clean +tst_exit diff --git a/test/moduletest/runtest/bin/rss_monitor_t/testcases/bin/rss_monitor02.sh b/test/moduletest/runtest/bin/rss_monitor_t/testcases/bin/rss_monitor02.sh new file mode 100644 index 0000000000000000000000000000000000000000..1112dd25612798d7740e0e5f1a031f8ad6c86588 --- /dev/null +++ b/test/moduletest/runtest/bin/rss_monitor_t/testcases/bin/rss_monitor02.sh @@ -0,0 +1,55 @@ +#!/bin/sh +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: rss_monitor02.sh +# +# Description: Verify /proc/pid/rss_threshold default value +# +# Authors: Liu Ke - liuke94@huawei.com +# +# History: Oct 27 2022 - init scripts +# +################################################################################ +source tst_oh.sh + +do_setup() +{ + zcat /proc/config.gz | grep CONFIG_RSS_THRESHOLD=y || tst_res TCONF "CONFIG_RSS_THRESHOLD=y not satisfied!" +} + +do_test() +{ + local ret=0 + tst_res TINFO "Start to verify rss_threshold default value ." + pid=$(ps -ef | grep com.ohos.systemui | awk 'NR==1 {print $2}') + value=$(cat /proc/$pid/rss_threshold | awk -F ':' '{print$2}'| awk '{print$1}') + echo $value + if [ "$value"x = "0"x ]; then + tst_res TPASS "rss_threshold default value correct." + else + tst_res TFAIL "rss_threshold default value incorrect." + ((ret++)) + fi + + +} + +do_clean() +{ + +} + +do_setup +do_test +do_clean +tst_exit diff --git a/test/moduletest/runtest/bin/rss_monitor_t/testcases/bin/rss_monitor03.sh b/test/moduletest/runtest/bin/rss_monitor_t/testcases/bin/rss_monitor03.sh new file mode 100644 index 0000000000000000000000000000000000000000..b11a85bb56ad6f5f08d760105f3b844e73cb8432 --- /dev/null +++ b/test/moduletest/runtest/bin/rss_monitor_t/testcases/bin/rss_monitor03.sh @@ -0,0 +1,55 @@ +#!/bin/sh +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: rss_monitor03.sh +# +# Description: Verify /proc/pid/rss_threshold value +# +# Authors: Wulisai - wulisai@h-partners.com +# +# History: Oct 24 2022 - init scripts +# +################################################################################ +source tst_oh.sh + +do_setup() +{ + zcat /proc/config.gz | grep CONFIG_RSS_THRESHOLD=y || tst_res TCONF "CONFIG_RSS_THRESHOLD=y not satisfied!" +} + +do_test() +{ + + local ret = 0 + pid=$(ps -ef | grep com.ohos.systemui | awk 'NR==1 {print $2}') + echo 2000 > /proc/$pid/rss_threshold + value=$(cat /proc/$pid/rss_threshold | awk -F ':' '{print$2}'| awk '{print$1}') + if [ "$value"x = "2000"x ]; then + tst_res TPASS "rss_threshold value correct." + else + tst_res TFAIL "rss_threshold value incorrect." + ((ret++)) + fi + + +} + +do_clean() +{ + +} + +do_setup +do_test +do_clean +tst_exit diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/create_process.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/create_process.sh index 6a9521c800767d210dfca90df590ca4543208422..d464621b5e807d7f598b7d0ca263c461f291ffa4 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/create_process.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/create_process.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh index 571c3b432ad43e038e975d5b176ee739652f2d70..2177f912782702ca67cfaad20bcfe6f97fd4e16e 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh index 664fdbf22ea3f3577e902bab2a600201052eb3fe..c665044d85e81d4a2edb8b4a5220d6fc81a9d6b4 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh index d4c0e8f102709282860a3a6936c6e72787dc13dd..384ab263556b0c3e3cadbd6a349a5a57202f1e70 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh index a74fa4db1516d46523c5134c3019fd612714098c..3f39855f233a0a3f7521cfe956e5b29d177c0847 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh index 337dac98ad3df67c613b18dc913ae90415d6ef6c..5e2723f7ad2e0000fb5b5ebb3f24773b82ea3317 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/conf/OH_RK3568_config b/test/moduletest/runtest/conf/OH_RK3568_config index 66603f459a3cb2b3cab7941a20ff8dd0ce161f6d..6daf8761131644cdd8315d69318311cfac5fd5a9 100644 --- a/test/moduletest/runtest/conf/OH_RK3568_config +++ b/test/moduletest/runtest/conf/OH_RK3568_config @@ -29,3 +29,6 @@ enhancedswap_t sched_rtg_t enhancedf2fs_t mem_debug_t +rss_monitor_t +purgeable_t +memorycontrol_t diff --git a/test/moduletest/runtest/lib/libapi.sh b/test/moduletest/runtest/lib/libapi.sh index 86162652753fd52e053a63db1e58fd53d53f1e72..2cee1a0c1b3155b863d7db65573bfb0fe15340fc 100644 --- a/test/moduletest/runtest/lib/libapi.sh +++ b/test/moduletest/runtest/lib/libapi.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/lib/tst_oh.sh b/test/moduletest/runtest/lib/tst_oh.sh index 3fb9a9401e771da2e23aac6a420b7d34056dada9..3d3826d096fe8aa3fcd22b83628fbbb4755eb3ac 100644 --- a/test/moduletest/runtest/lib/tst_oh.sh +++ b/test/moduletest/runtest/lib/tst_oh.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/moduletest/runtest/tests/memorycontrol_t b/test/moduletest/runtest/tests/memorycontrol_t new file mode 100644 index 0000000000000000000000000000000000000000..a810a9b8e7265aef01c91ce8be5567c18d1aaae9 --- /dev/null +++ b/test/moduletest/runtest/tests/memorycontrol_t @@ -0,0 +1,26 @@ +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: memorycontrol_t +# +# Description: memorycontrol_t testcase list +# +# Authors: Wu Lisai - wulisai@huawei-partners.com +# +# History: Nov 18 2022 - init scripts +# +################################################################################ + +memory_control01 memory_control01.sh +memory_control02 memory_control02.sh +memory_control03 memory_control03.sh + diff --git a/test/moduletest/runtest/tests/purgeable_t b/test/moduletest/runtest/tests/purgeable_t new file mode 100644 index 0000000000000000000000000000000000000000..1d1190606c21d5f634c66f6319eae61af1db3481 --- /dev/null +++ b/test/moduletest/runtest/tests/purgeable_t @@ -0,0 +1,24 @@ +################################################################################ +## +## Copyright (C) 2022 Huawei Device Co., Ltd. +## SPDX-License-Identifier: GPL-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## +################################################################################ +# File: purgeable_t +# +# Description: cpuisolation testcase list +# +# Authors: Ke Liu - liuke94@huawei.com +# +# History: Nov 2 2022 - init scripts +# +################################################################################ +purgeable_mem01 purgeable_mem01.sh +purgeable_mem02 purgeable_mem02.sh +purgeable_mem03 purgeable_mem03.sh diff --git a/test/moduletest/runtest/tests/rss_monitor_t b/test/moduletest/runtest/tests/rss_monitor_t new file mode 100644 index 0000000000000000000000000000000000000000..7b657ad5fd71ae249c8275faffe97f81b190e4bb --- /dev/null +++ b/test/moduletest/runtest/tests/rss_monitor_t @@ -0,0 +1,26 @@ +################################################################################ +# +# Copyright (C) 2022 Huawei Device Co., Ltd. +# SPDX-License-Identifier: GPL-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# File: rss_monitor_t +# +# Description: rss_monitor_t testcase list +# +# Authors: Liu Ke - liuke94@huawei.com +# +# History: Sep 20 2022 - init scripts +# +################################################################################ + +rss_monitor01 rss_monitor01.sh +rss_monitor02 rss_monitor02.sh +rss_monitor03 rss_monitor03.sh + diff --git a/test/tracepointtest/emmc.h b/test/tracepointtest/emmc.h index 290da58e3e56d7fe5734de221398a4ada85eb193..166c6861fbfc869f103655765059e4f332e75cc4 100644 --- a/test/tracepointtest/emmc.h +++ b/test/tracepointtest/emmc.h @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/tracepointtest/tracepoint.sh b/test/tracepointtest/tracepoint.sh index 440369f4368a5274b4cbcf32af42bb69e66909bf..53006449c1050dc0206144eefced59806c485c7e 100755 --- a/test/tracepointtest/tracepoint.sh +++ b/test/tracepointtest/tracepoint.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/tracepointtest/tracepoint_test/tracepoint_test.c b/test/tracepointtest/tracepoint_test/tracepoint_test.c index 99b7b37ac16f23d7279e8822fd001959c9082ecb..2510ee08a4dafc3c3c708c3febef7b514b497116 100644 --- a/test/tracepointtest/tracepoint_test/tracepoint_test.c +++ b/test/tracepointtest/tracepoint_test/tracepoint_test.c @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/tracepointtest/tracepointtestko.sh b/test/tracepointtest/tracepointtestko.sh index b3e7e1e261c9375bbce2c4b14f60149742ab4000..9da73230328043a9af44368e230d84e8a2cd272d 100755 --- a/test/tracepointtest/tracepointtestko.sh +++ b/test/tracepointtest/tracepointtestko.sh @@ -4,9 +4,6 @@ # Copyright (C) 2022 Huawei Device Co., Ltd. # SPDX-License-Identifier: GPL-2.0 # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. -# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/tracepointtest/vendoramlemmcpartition_test/vendoramlemmcpartition_test.c b/test/tracepointtest/vendoramlemmcpartition_test/vendoramlemmcpartition_test.c index bca84824ee89fbcb37a2a5818747304274e5de52..a2e0b243b580b9488e1e0f12b1e4febf10bb1ef4 100644 --- a/test/tracepointtest/vendoramlemmcpartition_test/vendoramlemmcpartition_test.c +++ b/test/tracepointtest/vendoramlemmcpartition_test/vendoramlemmcpartition_test.c @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/tracepointtest/vendordommap_test/vendordommap_test.c b/test/tracepointtest/vendordommap_test/vendordommap_test.c index 714b0f2167e722387a8972c751f50f9e75133460..e109b62146bbada835531ceb890306b7b1e2f1f8 100644 --- a/test/tracepointtest/vendordommap_test/vendordommap_test.c +++ b/test/tracepointtest/vendordommap_test/vendordommap_test.c @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/tracepointtest/vendordomprotectpkey_test/vendordomprotectpkey_test.c b/test/tracepointtest/vendordomprotectpkey_test/vendordomprotectpkey_test.c index 9370a08a40aaad996f1ed58510793534687c045f..4f67eb568a89a92731e7e96d91528768f5e828fe 100644 --- a/test/tracepointtest/vendordomprotectpkey_test/vendordomprotectpkey_test.c +++ b/test/tracepointtest/vendordomprotectpkey_test/vendordomprotectpkey_test.c @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/tracepointtest/vendorfakebootpartition_test/vendorfakebootpartition_test.c b/test/tracepointtest/vendorfakebootpartition_test/vendorfakebootpartition_test.c index dbf98100b5676b0df39f06447bfb3dcef0ba5dc8..8cbbb85050ebf275d2bb3214fb0b636b25084293 100644 --- a/test/tracepointtest/vendorfakebootpartition_test/vendorfakebootpartition_test.c +++ b/test/tracepointtest/vendorfakebootpartition_test/vendorfakebootpartition_test.c @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/test/unittest/accesstokenid/accesstokenid_test.cpp b/test/unittest/accesstokenid/accesstokenid_test.cpp index 5ba93c934e3ebc73f64f13a44f1f7d2d5d250dfd..00f6898be583b0acaecaa9741437d6bb8f7ce36d 100644 --- a/test/unittest/accesstokenid/accesstokenid_test.cpp +++ b/test/unittest/accesstokenid/accesstokenid_test.cpp @@ -2,9 +2,6 @@ * Copyright (c) 2022 Huawei Device Co., Ltd. * SPDX-License-Identifier: GPL-2.0 * - * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. - * Do not use in new code. - * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -172,7 +169,7 @@ static void GetCurToken(unsigned long long *token, unsigned long long *ftoken) static void *CheckChildThreadInheritance(void *args) { - struct tokeninfo *tinfo = (struct tokeninfo *) args; + struct tokeninfo *tinfo = static_cast (args); tinfo->pid = getpid(); tinfo->tid = gettid(); @@ -185,7 +182,7 @@ static void *CheckChildThreadInheritance(void *args) static void *CheckChildThreadSetIndepent(void *args) { - struct tokeninfo *tinfo = (struct tokeninfo *) args; + struct tokeninfo *tinfo = static_cast (args); unsigned long long tokenSet = GenRand64(); unsigned long long ftokenSet = GenRand64(); unsigned long long tokenidGet = INVAL_TOKEN; diff --git a/test/unittest/accesstokenid/accesstokenid_test.h b/test/unittest/accesstokenid/accesstokenid_test.h index d09d169a7c43c7fbec2e039a6f1ba6062f3ab06a..da2970981b312e02bf1993b547d3e96c5cbdf9f6 100644 --- a/test/unittest/accesstokenid/accesstokenid_test.h +++ b/test/unittest/accesstokenid/accesstokenid_test.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 -# -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. + * SPDX-License-Identifier: GPL-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/test/unittest/rtg/Test.json b/test/unittest/rtg/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..2d9fd70df937f16552d213961e92d869b93653bb --- /dev/null +++ b/test/unittest/rtg/Test.json @@ -0,0 +1,19 @@ +{ + "description": "Configuration for rtg_test", + "kits": [ + { + "push": [ + "rtg_test->/data/local/tmp/rtg_test" + ], + "type": "PushKit" + } + ], + "driver": { + "native-test-timeout": "120000", + "type": "CppTest", + "module-name": "rtg_test", + "runtime-hint": "1s", + "native-test-device-path": "/data/local/tmp" + } +} + diff --git a/test/unittest/rtg/rtg_test.cpp b/test/unittest/rtg/rtg_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ad78f1e9cbc9907520fe5a9d1345f5456f5b57fa --- /dev/null +++ b/test/unittest/rtg/rtg_test.cpp @@ -0,0 +1,412 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "rtg_test.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace testing::ext; +using namespace std; + +// constexpr size_t MAX_LENGTH = 100; +// constexpr size_t MAX_STR_LEN = 100; +const char RTG_SCHED_IPC_MAGIC = 0xAB; +const int RTG_ERR = -1; +const int RTG_SUCC = 0; +const int MAX_TID_NUM = 5; +const int MULTI_FRAME_NUM = 5; + +#define CMD_ID_SET_ENABLE \ + _IOWR(RTG_SCHED_IPC_MAGIC, SET_ENABLE, struct rtg_enable_data) +#define CMD_ID_SET_RTG \ + _IOWR(RTG_SCHED_IPC_MAGIC, SET_RTG, struct rtg_str_data) +#define CMD_ID_BEGIN_FRAME_FREQ \ + _IOWR(RTG_SCHED_IPC_MAGIC, BEGIN_FRAME_FREQ, struct proc_state_data) +struct rtg_enable_data { + int enable; + int len; + char *data; +}; + +struct rtg_str_data { + int type; + int len; + char *data; +}; + +struct proc_state_data { + int grp_id; + int state_param; +}; + +enum grp_ctrl_cmd { + CMD_CREATE_RTG_GRP, + CMD_ADD_RTG_THREAD, + CMD_REMOVE_RTG_THREAD, + CMD_CLEAR_RTG_GRP, + CMD_DESTROY_RTG_GRP +}; + +struct rtg_grp_data { + int rtg_cmd; + int grp_id; + int prio_type; + int rt_cnt; + int tid_num; + int tids[MAX_TID_NUM]; +}; + +struct rtg_info { + int rtg_num; + int rtgs[MULTI_FRAME_NUM]; +}; + +enum rtg_sched_cmdid { + SET_ENABLE = 1, + SET_RTG, + SET_CONFIG, + SET_RTG_ATTR, + BEGIN_FRAME_FREQ = 5, + END_FRAME_FREQ, + END_SCENE, + SET_MIN_UTIL, + SET_MARGIN, + LIST_RTG = 10, + LIST_RTG_THREAD, + SEARCH_RTG, + GET_ENABLE, + RTG_CTRL_MAX_NR, +}; + +enum rtg_type : int { + VIP = 0, + TOP_TASK_KEY, + NORMAL_TASK, + RTG_TYPE_MAX, +}; + +static int BasicOpenRtgNode() +{ + char fileName[] = "/proc/self/sched_rtg_ctrl"; + int fd = open(fileName, O_RDWR); + + if (fd < 0) { + cout << "open node err." << endl; + } + + return fd; +} + +static int EnableRtg(bool flag) +{ + struct rtg_enable_data enableData; + char configStr[] = "load_freq_switch:1;sched_cycle:1"; + + enableData.enable = flag; + enableData.len = sizeof(configStr); + enableData.data = configStr; + int fd = BasicOpenRtgNode(); + if (fd < 0) { + return RTG_ERR; + } + if (ioctl(fd, CMD_ID_SET_ENABLE, &enableData)) { + close(fd); + return RTG_ERR; + } + + close(fd); + return 0; +} + +static int CreateNewRtgGrp(int prioType, int rtNum) +{ + struct rtg_grp_data grp_data; + int ret; + int fd = BasicOpenRtgNode(); + if (fd < 0) { + return RTG_ERR; + } + (void)memset_s(&grp_data, sizeof(struct rtg_grp_data), 0, sizeof(struct rtg_grp_data)); + if ((prioType > 0) && (prioType < RTG_TYPE_MAX)) { + grp_data.prio_type = prioType; + } + if (rtNum > 0) { + grp_data.rt_cnt = rtNum; + } + grp_data.rtg_cmd = CMD_CREATE_RTG_GRP; + ret = ioctl(fd, CMD_ID_SET_RTG, &grp_data); + + close(fd); + return ret; +} + +static int DestroyRtgGrp(int GrpId) +{ + struct rtg_grp_data grp_data; + int ret; + int fd = BasicOpenRtgNode(); + if (fd < 0) { + return fd; + } + (void)memset_s(&grp_data, sizeof(struct rtg_grp_data), 0, sizeof(struct rtg_grp_data)); + grp_data.rtg_cmd = CMD_DESTROY_RTG_GRP; + grp_data.grp_id = GrpId; + ret = ioctl(fd, CMD_ID_SET_RTG, &grp_data); + + close(fd); + return ret; +} + +static int AddThreadToRtg(int tid, int grpId, int prioType) +{ + struct rtg_grp_data grp_data; + int ret; + int fd = BasicOpenRtgNode(); + if (fd < 0) { + return fd; + } + (void)memset_s(&grp_data, sizeof(struct rtg_grp_data), 0, sizeof(struct rtg_grp_data)); + grp_data.tid_num = 1; + grp_data.tids[0] = tid; + grp_data.grp_id = grpId; + grp_data.rtg_cmd = CMD_ADD_RTG_THREAD; + grp_data.prio_type = prioType; + ret = ioctl(fd, CMD_ID_SET_RTG, &grp_data); + + close(fd); + return ret; +} + +static int ClearRtgGrp(int GrpId) +{ + struct rtg_grp_data grp_data; + int ret; + int fd = BasicOpenRtgNode(); + if (fd < 0) { + return fd; + } + (void)memset_s(&grp_data, sizeof(struct rtg_grp_data), 0, sizeof(struct rtg_grp_data)); + grp_data.rtg_cmd = CMD_CLEAR_RTG_GRP; + grp_data.grp_id = GrpId; + ret = ioctl(fd, CMD_ID_SET_RTG, &grp_data); + if (ret < 0) { + return ret; + } + + close(fd); + return ret; +}; + +static int BeginFrameFreq(int grpId, int stateParam) +{ + int ret = 0; + struct proc_state_data state_data; + state_data.grp_id = grpId; + state_data.state_param = stateParam; + + int fd = BasicOpenRtgNode(); + if (fd < 0) { + return fd; + } + ret = ioctl(fd, CMD_ID_BEGIN_FRAME_FREQ, &state_data); + + close(fd); + return ret; +} + +void RtgTest::SetUp() { + // must enable rtg before use the interface + int ret = EnableRtg(true); + ASSERT_EQ(RTG_SUCC, ret); +} + +void RtgTest::TearDown() { + // disable rtg after use the interface + int ret = EnableRtg(false); + ASSERT_EQ(RTG_SUCC, ret); +} + +void RtgTest::SetUpTestCase() {} + +void RtgTest::TearDownTestCase() {} + +/** + * @tc.name: setEnableSucc + * @tc.desc: Verify the enable rtg function. + * @tc.type: FUNC + */ +HWTEST_F(RtgTest, setEnableSucc, Function | MediumTest | Level1) +{ + int ret; + + // test set enable again + ret = EnableRtg(true); + ASSERT_EQ(RTG_SUCC, ret); + + // test set disable again + ret = EnableRtg(false); + ASSERT_EQ(RTG_SUCC, ret); +} + +/** + * @tc.name: createAndDestroyRtgSucc + * @tc.desc: Verify the create and destroy rtggrp function. + * @tc.type: FUNC + */ +HWTEST_F(RtgTest, createAndDestroyRtgSucc, Function | MediumTest | Level1) +{ + int ret; + int grpId; + + grpId = CreateNewRtgGrp(NORMAL_TASK, 0); + ASSERT_GT(grpId, 0); + ret = DestroyRtgGrp(grpId); + ASSERT_EQ(ret, 0); +} + +/** + * @tc.name: destoryErrorRtgGrp + * @tc.desc: Verify Destroy function with error param. + * @tc.type: FUNC + */ +HWTEST_F(RtgTest, destoryErrorRtgGrp, Function | MediumTest | Level1) +{ + int ret; + ret = DestroyRtgGrp(-1); + ASSERT_NE(RTG_SUCC, ret); +} + +/** + * @tc.name: addRtgGrpSucc + * @tc.desc: Verify add rtg function. + * @tc.type: FUNC + */ +HWTEST_F(RtgTest, addRtgGrpSucc, Function | MediumTest | Level1) +{ + int ret; + int grpId; + int pid = getpid(); + + grpId = CreateNewRtgGrp(VIP, 0); + ASSERT_GT(grpId, 0); + ret = AddThreadToRtg(pid, grpId, VIP); + ASSERT_EQ(ret, 0); + ret = DestroyRtgGrp(grpId); + ASSERT_EQ(ret, 0); +} + +/** + * @tc.name: addRtgGrpFail + * @tc.desc: Verify add rtg function with error param. + * @tc.type: FUNC + */ +HWTEST_F(RtgTest, addRtgGrpFail, Function | MediumTest | Level1) +{ + int ret; + int grpId; + int pid = getpid(); + + grpId = CreateNewRtgGrp(VIP, 0); + ASSERT_GT(grpId, 0); + + // error tid + ret = AddThreadToRtg(-1, grpId, VIP); + ASSERT_NE(ret, 0); + + // error grpid + ret=AddThreadToRtg(pid, -1, VIP); + ASSERT_NE(ret, RTG_SUCC); + ret = DestroyRtgGrp(grpId); + ASSERT_EQ(ret, 0); +} + +/** + * @tc.name: clearRtgSucc + * @tc.desc: Verify clear rtg function. + * @tc.type: FUNC + */ +HWTEST_F(RtgTest, clearRtgSucc, Function | MediumTest | Level1) +{ + int ret; + int grpId; + int pid = getpid(); + + grpId = CreateNewRtgGrp(VIP, 0); + ASSERT_GT(grpId, 0); + ret = AddThreadToRtg(pid, grpId, VIP); + ASSERT_EQ(ret, RTG_SUCC); + ret = ClearRtgGrp(grpId); + ASSERT_EQ(ret, RTG_SUCC); + ret = DestroyRtgGrp(grpId); + ASSERT_EQ(ret, RTG_SUCC); +} + +/** + * @tc.name: clearRtgFail + * @tc.desc: Verify clear rtg function with error param. + * @tc.type: FUNC + */ +HWTEST_F(RtgTest, clearRtgFail, Function | MediumTest | Level1) +{ + int ret; + + ret = ClearRtgGrp(-1); + ASSERT_NE(ret, RTG_SUCC); +} + +/** + * @tc.name: begainFrameFreqSucc + * @tc.desc: Verify rtg frame start function. + * @tc.type: FUNC + */ +HWTEST_F(RtgTest, begainFrameFreqSucc, Function | MediumTest | Level1) +{ + int ret; + int grpId; + + grpId = CreateNewRtgGrp(VIP, 0); + ASSERT_GT(grpId, 0); + ret = BeginFrameFreq(grpId, 0); + ASSERT_EQ(ret, RTG_SUCC); + ret = DestroyRtgGrp(grpId); + ASSERT_EQ(ret, RTG_SUCC); +} + +/** + * @tc.name: begainFrameFreqFail + * @tc.desc: Verify rtg frame start function with error param. + * @tc.type: FUNC + */ +HWTEST_F(RtgTest, begainFrameFreqFail, Function | MediumTest | Level1) +{ + int ret; + ret = BeginFrameFreq(-1, 0); + ASSERT_NE(ret, RTG_SUCC); +} diff --git a/test/unittest/rtg/rtg_test.h b/test/unittest/rtg/rtg_test.h new file mode 100644 index 0000000000000000000000000000000000000000..213c2c09b5fb4f22d84382d53974164421e472a6 --- /dev/null +++ b/test/unittest/rtg/rtg_test.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * SPDX-License-Identifier: GPL-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef RTG_TEST_H +#define RTG_TEST_H + +#include + +class RtgTest : public testing::Test { +public: + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp(); + void TearDown(); +}; +#endif // RTG_TEST_H