From 560fcc099d90295891c3c1b1cfae55072e33e0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Wed, 24 May 2023 16:59:06 +0200 Subject: [PATCH] test/parted: delete `sectorsize` from expected data if not in output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `sfdisk` tool on RHEL-8 does not include the `sectorsize` in its output when we are testing the `parted` stage. As a result, the test case fails, because the expected and actual output differs. Modify the test to delete the `sectorsize` key from the expected output if it is not present in the actual output. Signed-off-by: Tomáš Hozza --- test/run/test_stages.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/run/test_stages.py b/test/run/test_stages.py index 476625d6..a962408a 100644 --- a/test/run/test_stages.py +++ b/test/run/test_stages.py @@ -408,6 +408,12 @@ class TestStages(test.TestBase): del p["uuid"] p["node"] = os.path.basename(p["node"]) + # Old versions of sfdisk (e.g. on RHEL-8), do not include + # the 'sectorsize' in the output, so we delete it from the + # expected output if it is not present in the actual output + if "sectorsize" not in table: + del want["partitiontable"]["sectorsize"] + self.assertEqual(have, want) # cache the downloaded data for the files source