From: Tom Hromatka Date: Wed, 3 Feb 2021 16:54:55 +0000 (-0700) Subject: ftests: Test 004 must be run within a container X-Git-Tag: v2.0.3~11^2^2~26^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f6dcca673b1fec067edebe8559a039210dc9d03;p=thirdparty%2Flibcgroup.git ftests: Test 004 must be run within a container Test 004-cgsnapshot-basic_snapshot_v1.py must be run within a container because the cgsnapshot data will vary slightly when inside/outside of a container. Add a check to its prereqs function to enforce this. Signed-off-by: Tom Hromatka --- diff --git a/ftests/004-cgsnapshot-basic_snapshot_v1.py b/ftests/004-cgsnapshot-basic_snapshot_v1.py index 70750312..5e5e38bd 100755 --- a/ftests/004-cgsnapshot-basic_snapshot_v1.py +++ b/ftests/004-cgsnapshot-basic_snapshot_v1.py @@ -2,7 +2,7 @@ # # Basic cgsnapshot functionality test # -# Copyright (c) 2020 Oracle and/or its affiliates. +# Copyright (c) 2020-2021 Oracle and/or its affiliates. # Author: Tom Hromatka # @@ -61,6 +61,12 @@ def prereqs(config): if CgroupVersion.get_version('memory') != CgroupVersion.CGROUP_V1: result = consts.TEST_SKIPPED cause = "This test requires the cgroup v1 memory controller" + return result, cause + + if not config.args.container: + result = consts.TEST_SKIPPED + cause = "This test must be run within a container" + return result, cause return result, cause