diff --git a/qubes/tests/integ/salt.py b/qubes/tests/integ/salt.py index 8e34df623..72e425a96 100644 --- a/qubes/tests/integ/salt.py +++ b/qubes/tests/integ/salt.py @@ -312,6 +312,12 @@ def test_000_simple_sls(self): state_id = 'file_|-/home/user/testfile_|-/home/user/testfile_|-managed' # drop the header json_data = state_output[len(expected_output):] + # workaround for https://github.com/saltstack/salt/issues/60476 + # (fixed upstream, but hasen't flowed into Fedora yet) + if "Setuptools is replacing distutils" in json_data: + json_data = "\n".join( + l for l in json_data.splitlines() + if "Setuptools is replacing distutils" not in l) try: state_output_json = json.loads(json_data) except json.decoder.JSONDecodeError as e: @@ -405,10 +411,17 @@ def test_001_multi_state_highstate(self): expected_output = vmname + ':\n' self.assertTrue(state_output.startswith(expected_output), 'Full output: ' + state_output) + json_data = state_output[len(expected_output):] + # workaround for https://github.com/saltstack/salt/issues/60476 + # (fixed upstream, but hasen't flowed into Fedora yet) + if "Setuptools is replacing distutils" in json_data: + json_data = "\n".join( + l for l in json_data.splitlines() + if "Setuptools is replacing distutils" not in l) try: - state_output_json = json.loads(state_output[len(expected_output):]) + state_output_json = json.loads(json_data) except json.decoder.JSONDecodeError as e: - self.fail('{}: {}'.format(e, state_output[len(expected_output):])) + self.fail('{}: {}'.format(e, json_data)) states = states + ('jinja',) for state in states: state_id = \ @@ -475,6 +488,12 @@ def test_002_grans_id(self): tpl_output = tpl_output[len(tplname + ':\n'):] for name, output in ((tplname, tpl_output), (vmname, appvm_output)): + # workaround for https://github.com/saltstack/salt/issues/60476 + # (fixed upstream, but hasen't flowed into Fedora yet) + if "Setuptools is replacing distutils" in output: + output = "\n".join( + l for l in output.splitlines() + if "Setuptools is replacing distutils" not in l) try: state_output_json = json.loads(output) except json.decoder.JSONDecodeError as e: