summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2022-07-15 11:19:23 -0500
committerJohn Estabrook <jestabro@vyos.io>2022-07-15 12:02:00 -0500
commit3631cf3e5293c8856d87112fe50b6c2713a42d81 (patch)
tree68a3f1bfc0553d2df0ac9b8ed6c6c8eff8cfdad4
parentc1fcacf1423469e0ba468aaf8f946a209ab5e776 (diff)
downloadvyos-1x-3631cf3e5293c8856d87112fe50b6c2713a42d81.tar.gz
vyos-1x-3631cf3e5293c8856d87112fe50b6c2713a42d81.zip
smoketest: component_version: print details on failure
-rwxr-xr-xsmoketest/scripts/cli/test_component_version.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/smoketest/scripts/cli/test_component_version.py b/smoketest/scripts/cli/test_component_version.py
index 777379bdd..1355c1f94 100755
--- a/smoketest/scripts/cli/test_component_version.py
+++ b/smoketest/scripts/cli/test_component_version.py
@@ -26,11 +26,25 @@ class TestComponentVersion(unittest.TestCase):
def setUp(self):
self.legacy_d = get_system_versions()
self.xml_d = get_system_component_version()
+ self.set_legacy_d = set(self.legacy_d)
+ self.set_xml_d = set(self.xml_d)
def test_component_version(self):
- self.assertTrue(set(self.legacy_d).issubset(set(self.xml_d)))
+ bool_issubset = (self.set_legacy_d.issubset(self.set_xml_d))
+ if not bool_issubset:
+ missing = self.set_legacy_d.difference(self.set_xml_d)
+ print(f'\n\ncomponents in legacy but not in XML: {missing}')
+ print('new components must be listed in xml-component-version.xml.in')
+ self.assertTrue(bool_issubset)
+
+ bad_component_version = False
for k, v in self.legacy_d.items():
- self.assertTrue(v <= self.xml_d[k])
+ bool_inequality = (v <= self.xml_d[k])
+ if not bool_inequality:
+ print(f'\n\n{k} has not been updated in XML component versions:')
+ print(f'legacy version {v}; XML version {self.xml_d[k]}')
+ bad_component_version = True
+ self.assertFalse(bad_component_version)
if __name__ == '__main__':
unittest.main(verbosity=2)