From 2c0dcbb3cd665faaa875453bcc6c44044b40fdfc Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Wed, 3 Feb 2021 10:07:36 -0700 Subject: [PATCH] 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 --- ftests/cgroup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.47.2