@@ -99,6 +99,10 @@ parser.add_argument('--cpu', help='Set QEMU CPU', type=int, default=2)
9999parser .add_argument ('--memory' , help = 'Set QEMU memory' , type = int , default = 4 )
100100parser .add_argument ('--vyconf' , help = 'Execute testsuite with vyconfd' , action = 'store_true' ,
101101 default = False )
102+ parser .add_argument ('--no-vpp' , help = 'Execute testsuite without VPP tests' ,
103+ action = 'store_true' , default = False )
104+ parser .add_argument ('--huge-page-size' , help = 'Huge page size (e.g., 2M, 1G)' , type = str )
105+ parser .add_argument ('--huge-page-count' , help = 'Number of huge pages to allocate' , type = int )
102106
103107args = parser .parse_args ()
104108
@@ -411,6 +415,22 @@ try:
411415 exit (1 )
412416
413417 #################################################
418+ # Configure boot options if required
419+ #################################################
420+ if args .huge_page_size and args .huge_page_count :
421+ c .sendline ('configure' )
422+ c .expect (cfg_mode_prompt )
423+ c .sendline (f'set system option kernel memory hugepage-size { args .huge_page_size } hugepage-count { args .huge_page_count } ' )
424+ c .expect (cfg_mode_prompt )
425+ c .sendline ('set system option kernel disable-mitigations' )
426+ c .expect (cfg_mode_prompt )
427+ c .sendline ('commit' )
428+ c .expect (cfg_mode_prompt )
429+ c .sendline ('save' )
430+ c .expect (cfg_mode_prompt )
431+ c .sendline ('exit' )
432+ c .expect (op_mode_prompt )
433+ #################################################
414434 # Installing into VyOS system
415435 #################################################
416436 log .info ('Starting installer' )
@@ -526,6 +546,14 @@ try:
526546
527547 loginVM (c , log )
528548
549+ #################################################
550+ # Boot options require a reboot
551+ #################################################
552+ if args .huge_page_size and args .huge_page_count :
553+ log .info ('Rebooting to apply kernel boot options' )
554+ c .sendline ('reboot now' )
555+ loginVM (c , log )
556+
529557 ################################################
530558 # Always load the WiFi simulation module
531559 ################################################
@@ -570,6 +598,12 @@ try:
570598 c .expect (op_mode_prompt )
571599 c .sendline ('show system memory' )
572600 c .expect (op_mode_prompt )
601+ c .sendline ('show system memory detail | no-more' )
602+ c .expect (op_mode_prompt )
603+ c .sendline ('show configuration commands | match kernel' )
604+ c .expect (op_mode_prompt )
605+ c .sendline ('cat /proc/cmdline' )
606+ c .expect (op_mode_prompt )
573607 c .sendline ('show version all | grep -e "vpp" -e "vyos-1x"' )
574608 c .expect (op_mode_prompt )
575609
@@ -806,6 +840,10 @@ try:
806840 # remove interface tests as they consume a lot of time
807841 c .sendline ('sudo rm -f /usr/libexec/vyos/tests/smoke/cli/test_interfaces_*' )
808842 c .expect (op_mode_prompt )
843+ if args .no_vpp :
844+ # remove VPP tests
845+ c .sendline ('sudo rm -f /usr/libexec/vyos/tests/smoke/cli/test_vpp*' )
846+ c .expect (op_mode_prompt )
809847
810848 if args .vyconf :
811849 c .sendline ('sudo /usr/libexec/vyos/set_vyconf_backend.py --no-prompt &> /dev/null' )
@@ -837,6 +875,26 @@ try:
837875
838876 # else, run configtest suite
839877 elif args .configtest :
878+ # Remove config-tests that we don't want to run
879+ if args .match :
880+ if args .match .startswith ("!" ):
881+ # Exclude mode — delete only the matched names
882+ names = args .match [1 :].split ("|" )
883+ match_str = '-o ' .join ([f'-name "{ name } "' for name in names ])
884+ cleanup_config_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config -mindepth 1 -maxdepth 1 \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
885+ cleanup_config_tests_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config-tests -mindepth 1 -maxdepth 1 \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
886+ else :
887+ # Include mode — keep only the matched names, delete the rest
888+ names = args .match .split ("|" )
889+ match_str = '-o ' .join ([f'-name "{ name } "' for name in names ])
890+ cleanup_config_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config -mindepth 1 -maxdepth 1 ! \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
891+ cleanup_config_tests_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config-tests -mindepth 1 -maxdepth 1 ! \\ ( { match_str } \\ ) -exec rm -rf {{}} +'
892+
893+ c .sendline (cleanup_config_dir_cmd )
894+ c .expect (op_mode_prompt )
895+ c .sendline (cleanup_config_tests_dir_cmd )
896+ c .expect (op_mode_prompt )
897+
840898 log .info ('Adding a legacy WireGuard default keypair for migrations' )
841899 c .sendline ('sudo mkdir -p /config/auth/wireguard/default' )
842900 c .expect (op_mode_prompt )
0 commit comments