From 66301ae5c30586d9b3a2f5aa4c314bfa4697779e 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/sgdisk: 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 `sgdisk` 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 a962408a..baa1ebfd 100644 --- a/test/run/test_stages.py +++ b/test/run/test_stages.py @@ -458,6 +458,12 @@ class TestStages(test.TestBase): for p in table["partitions"]: 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