diff --git a/tests/test_exec.py b/tests/test_exec.py index bafa84713..fb0cd59e1 100755 --- a/tests/test_exec.py +++ b/tests/test_exec.py @@ -43,6 +43,9 @@ def test_uid_tty(): if is_rootless(): return 77 + if os.isatty(1) == False: + return 77 + conf = base_config() conf['process']['args'] = ['/init', 'pause'] conf['process']['terminal'] = True diff --git a/tests/test_oci_features.py b/tests/test_oci_features.py index 80d426714..3ee23c413 100644 --- a/tests/test_oci_features.py +++ b/tests/test_oci_features.py @@ -27,7 +27,7 @@ def is_seccomp_enabled(): def get_crun_commit(): try: - output = subprocess.check_output(["./crun", "--version"]).decode() + output = subprocess.check_output([get_crun_path(), "--version"]).decode() commit_match = re.search(r"commit: ([\w]+)", output) if commit_match: diff --git a/tests/test_resources.py b/tests/test_resources.py index 20451a4e3..8974214fa 100755 --- a/tests/test_resources.py +++ b/tests/test_resources.py @@ -237,6 +237,7 @@ def test_resources_cpu_weight_systemd(): conf['linux']['resources'] = {} conf['linux']['resources']['unified'] = { + "cpu.weight": "1234" } cid = None @@ -251,6 +252,10 @@ def test_resources_cpu_weight_systemd(): scope = json.loads(state)['systemd-scope'] out = subprocess.check_output(['systemctl', 'show','-PCPUWeight', scope ], close_fds=False).decode().strip() + # try once more against the user manager, as if one exists, crun will prefer it; see bug #1197 + if out != "1234": + out = subprocess.check_output(['systemctl', '--user', 'show','-PCPUWeight', scope ], close_fds=False).decode().strip() + if out != "1234": sys.stderr.write("found wrong CPUWeight for the systemd scope\n") return 1 @@ -265,6 +270,10 @@ def test_resources_cpu_weight_systemd(): return -1 out = subprocess.check_output(['systemctl', 'show','-PCPUWeight', scope ], close_fds=False).decode().strip() + # as above + if out != expected_weight: + out = subprocess.check_output(['systemctl', '--user', 'show','-PCPUWeight', scope ], close_fds=False).decode().strip() + if out != expected_weight: sys.stderr.write("found wrong CPUWeight for the systemd scope\n") return 1