From: Tom Hromatka Date: Tue, 1 Jun 2021 22:08:13 +0000 (+0000) Subject: run.py: Ignore LXD cgroup v2 warning X-Git-Tag: v3.1.0~308^2~2^2~114^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4aff693d5d4a6bd0fa51c621a0e418c894bf08ac;p=thirdparty%2Flibcgroup.git run.py: Ignore LXD cgroup v2 warning On full cgroup v2 systems, LXD raises the following warning: WARNING: cgroup v2 is not fully supported yet Add logic to run.py to ignore this warning. A non-zero return code or other strings in stderr should still cause a RunError exception to be raised. Signed-off-by: Tom Hromatka --- diff --git a/ftests/run.py b/ftests/run.py index ad8f07d2..7ab4e512 100644 --- a/ftests/run.py +++ b/ftests/run.py @@ -53,9 +53,16 @@ class Run(object): "run:\n\tcommand = {}\n\tret = {}\n\tstdout = {}\n\tstderr = {}".format( ' '.join(command), ret, out, err)) - if ret != 0 or len(err) > 0: + if ret != 0: raise RunError("Command '{}' failed".format(''.join(command)), command, ret, out, err) + if ret != 0 or len(err) > 0: + if err.find("WARNING: cgroup v2 is not fully supported yet") == -1: + # LXD throws the above warning on systems that are fully + # running cgroup v2. Ignore this warning, but fail if any + # other warnings/errors are raised + raise RunError("Command '{}' failed".format(''.join(command)), + command, ret, out, err) return out