]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests: Test 004 must be run within a container
authorTom Hromatka <tom.hromatka@oracle.com>
Wed, 3 Feb 2021 16:54:55 +0000 (09:54 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 3 Feb 2021 22:11:43 +0000 (22:11 +0000)
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 <tom.hromatka@oracle.com>
ftests/004-cgsnapshot-basic_snapshot_v1.py

index 70750312f40c1e436076b69b857ed6691f038f6f..5e5e38bd35ac34456d30756a9f4e378a1e3f8088 100755 (executable)
@@ -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 <tom.hromatka@oracle.com>
 #
 
@@ -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