From 89d930aee010514431302975c90b28b9f8c5a8d9 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 26 Jun 2024 15:33:05 +0200 Subject: smoketest: T6510: make verification of migrated configurations mandatory For every configuration that is tested from smoketest/configs, there must be a matching smoketest/config-tests file that has all the `set` commands after the migration. Example of missing testcases: vyos@vyos:~$ /usr/bin/vyos-configtest Generating tests Loaded migration result test for config "basic-api-service" Loaded migration result test for config "basic-vyos" Missing migration result test for config "bgp-azure-ipsec-gateway" ... aborted --- smoketest/bin/vyos-configtest | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'smoketest') diff --git a/smoketest/bin/vyos-configtest b/smoketest/bin/vyos-configtest index c1b602737..fbf4055ad 100755 --- a/smoketest/bin/vyos-configtest +++ b/smoketest/bin/vyos-configtest @@ -55,7 +55,7 @@ def make_test_function(filename, test_path=None): if test_path: config_commands = self.session.show(['configuration', 'commands']) - + with open(test_path, 'r') as f: for line in f.readlines(): if not line or line.startswith("#"): @@ -83,9 +83,10 @@ if __name__ == '__main__': test_path = os.path.join(config_test_dir, config) if not os.path.exists(test_path): - test_path = None - else: - log.info(f'Loaded migration result test for config "{config}"') + log.error(f'Missing migration result test for config "{config}"') + sys.exit(1) + + log.info(f'Loaded migration result test for config "{config}"') test_func = make_test_function(config, test_path) -- cgit v1.2.3