@@ -913,18 +913,19 @@ try:
913913
914914 elif args .smoketest :
915915 # run default smoketest suite
916+ smoketests_path = '/usr/libexec/vyos/tests/smoke'
916917 if args .match :
917918 # Remove tests that we don't want to run
918919 match_str = '-o ' .join ([f'-name "test_*{ name } *.py" ' for name in args .match .split ("|" )]).strip ()
919- c .sendline (f'sudo find /usr/libexec/vyos/tests/smoke -maxdepth 2 -type f -name test_* ! \( { match_str } \) -delete' )
920+ c .sendline (f'sudo find { smoketests_path } -maxdepth 2 -type f -name test_* ! \( { match_str } \) -delete' )
920921 c .expect (op_mode_prompt )
921922 if args .no_interfaces :
922923 # remove interface tests as they consume a lot of time
923- c .sendline ('sudo rm -f /usr/libexec/vyos/tests/smoke /cli/test_interfaces_*' )
924+ c .sendline ('sudo rm -f {smoketests_path} /cli/test_interfaces_*' )
924925 c .expect (op_mode_prompt )
925926 if args .no_vpp :
926927 # remove VPP tests
927- c .sendline ('sudo rm -f /usr/libexec/vyos/tests/smoke /cli/test_vpp*' )
928+ c .sendline ('sudo rm -f {smoketests_path} /cli/test_vpp*' )
928929 c .expect (op_mode_prompt )
929930
930931 if args .vyconf :
@@ -959,24 +960,26 @@ try:
959960 elif args .configtest :
960961 # Remove config-tests that we don't want to run
961962 if args .match :
963+ configs_path = '/usr/libexec/vyos/tests/configs'
962964 if args .match .startswith ("!" ):
963965 # Exclude mode — delete only the matched names
964966 names = args .match [1 :].split ("|" )
965967 match_str = '-o ' .join ([f'-name "{ name } "' for name in names ])
966- cleanup_config_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config -mindepth 1 -maxdepth 1 \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
967- cleanup_config_tests_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config-tests -mindepth 1 -maxdepth 1 \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
968+ cleanup_config_dir_cmd = f'sudo find { configs_path } -mindepth 1 -maxdepth 1 -type f \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
969+ cleanup_config_tests_dir_cmd = f'sudo find { configs_path } /assert -mindepth 1 -maxdepth 1 -type f \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
968970 else :
969971 # Include mode — keep only the matched names, delete the rest
970972 names = args .match .split ("|" )
971973 match_str = '-o ' .join ([f'-name "{ name } "' for name in names ])
972- cleanup_config_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config -mindepth 1 -maxdepth 1 ! \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
973- cleanup_config_tests_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config-tests -mindepth 1 -maxdepth 1 ! \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
974+ cleanup_config_dir_cmd = f'sudo find { configs_path } -mindepth 1 -maxdepth 1 -type f ! \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
975+ cleanup_config_tests_dir_cmd = f'sudo find { configs_path } /assert -mindepth 1 -maxdepth 1 -type f ! \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
974976
975977 c .sendline (cleanup_config_dir_cmd )
976978 c .expect (op_mode_prompt )
977979 c .sendline (cleanup_config_tests_dir_cmd )
978980 c .expect (op_mode_prompt )
979981
982+
980983 log .info ('Adding a legacy WireGuard default keypair for migrations' )
981984 c .sendline ('sudo mkdir -p /config/auth/wireguard/default' )
982985 c .expect (op_mode_prompt )
0 commit comments