From: Tom Hromatka Date: Wed, 3 Feb 2021 17:07:36 +0000 (-0700) Subject: ftests: Ensure the deny list file exists X-Git-Tag: v2.0.3~11^2^2~26^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c0dcbb3cd665faaa875453bcc6c44044b40fdfc;p=thirdparty%2Flibcgroup.git ftests: Ensure the deny list file exists 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 --- diff --git a/ftests/cgroup.py b/ftests/cgroup.py index 4ff64c6f..947cbbe9 100644 --- a/ftests/cgroup.py +++ b/ftests/cgroup.py @@ -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)