]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests: Ensure the deny list file exists
authorTom Hromatka <tom.hromatka@oracle.com>
Wed, 3 Feb 2021 17:07:36 +0000 (10:07 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 3 Feb 2021 22:12:04 +0000 (22:12 +0000)
It's possible that the libcgroup tests are being run
on a system that doesn't have libcgroup installed.
Ensure that the deny list file (currently named
cgsnapshot_blacklist.conf but slated to be renamed)
exists.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/cgroup.py

index 4ff64c6f3224c116905e456afa2f6594c6a79986..947cbbe940ecd3a102ec10a4e36069a65e6a303e 100644 (file)
@@ -336,11 +336,11 @@ class Cgroup(object):
         if controller is not None:
             cmd.append(controller)
 
+        # ensure the deny list file exists
         if config.args.container:
-            # if we're running in a container, it's unlikely that libcgroup
-            # was installed and thus /etc/cgsnapshot_blacklist.conf likely
-            # doesn't exist.  Let's make it
             config.container.run(['sudo', 'touch', '/etc/cgsnapshot_blacklist.conf'])
+        else:
+            Run.run(['sudo', 'touch', '/etc/cgsnapshot_blacklist.conf'])
 
         if config.args.container:
             res = config.container.run(cmd)