summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav <v.gletenko@vyos.io>2025-07-03 06:05:06 +0000
committerViacheslav <v.gletenko@vyos.io>2025-07-03 06:05:06 +0000
commit7807f0d0e86d866d993c5d31292e3206e4e88cfd (patch)
tree66206fa68549b1f5aa65486bae96e88cf0cbf4cf
parenta245f81e0628e2190e51cb863af5a506a8d1fec7 (diff)
downloadvyos-build-7807f0d0e86d866d993c5d31292e3206e4e88cfd.tar.gz
vyos-build-7807f0d0e86d866d993c5d31292e3206e4e88cfd.zip
T7606: Add include and exclude mode for match check-install qemu
-rwxr-xr-xscripts/check-qemu-install20
1 files changed, 16 insertions, 4 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install
index 8d6dbece..53e1c74d 100755
--- a/scripts/check-qemu-install
+++ b/scripts/check-qemu-install
@@ -875,12 +875,24 @@ try:
# else, run configtest suite
elif args.configtest:
+ # Remove config-tests that we don't want to run
if args.match:
- # Remove config-tests that we don't want to run
- match_str = '-o '.join([f'-name "{name}"' for name in args.match.split("|")])
- c.sendline(f'sudo find /usr/libexec/vyos/tests/config -mindepth 1 -maxdepth 1 ! \( {match_str} \) -exec rm -rf {{}} +')
+ if args.match.startswith("!"):
+ # Exclude mode — delete only the matched names
+ names = args.match[1:].split("|")
+ match_str = '-o '.join([f'-name "{name}"' for name in names])
+ cleanup_config_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config -mindepth 1 -maxdepth 1 \\( {match_str} \\) -exec rm -rf {{}} +'
+ cleanup_config_tests_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config-tests -mindepth 1 -maxdepth 1 \\( {match_str} \\) -exec rm -rf {{}} +'
+ else:
+ # Include mode — keep only the matched names, delete the rest
+ names = args.match.split("|")
+ match_str = '-o '.join([f'-name "{name}"' for name in names])
+ cleanup_config_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config -mindepth 1 -maxdepth 1 ! \\( {match_str} \\) -exec rm -rf {{}} +'
+ cleanup_config_tests_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config-tests -mindepth 1 -maxdepth 1 ! \\( {match_str} \\) -exec rm -rf {{}} +'
+
+ c.sendline(cleanup_config_dir_cmd)
c.expect(op_mode_prompt)
- c.sendline(f'sudo find /usr/libexec/vyos/tests/config-tests -mindepth 1 -maxdepth 1 ! \( {match_str} \) -exec rm -rf {{}} +')
+ c.sendline(cleanup_config_tests_dir_cmd)
c.expect(op_mode_prompt)
log.info('Adding a legacy WireGuard default keypair for migrations')