From 1aceb0371c9d17792066648089ee753008cf2de0 Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Wed, 2 Jul 2025 09:12:43 +0000 Subject: T7606: Split VPP test for smoketest Exclude VPP tests from the general tests Add the PHONY no-interfaces-no-vpp Add the PHONE testcvpp (load VPP config only) --- scripts/check-qemu-install | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts/check-qemu-install') diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 3d4a7182..e673e3e3 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -99,6 +99,8 @@ parser.add_argument('--cpu', help='Set QEMU CPU', type=int, default=2) parser.add_argument('--memory', help='Set QEMU memory', type=int, default=4) parser.add_argument('--vyconf', help='Execute testsuite with vyconfd', action='store_true', default=False) +parser.add_argument('--no-vpp', help='Execute testsuite without VPP tests', + action='store_true', default=False) args = parser.parse_args() @@ -806,6 +808,10 @@ try: # remove interface tests as they consume a lot of time c.sendline('sudo rm -f /usr/libexec/vyos/tests/smoke/cli/test_interfaces_*') c.expect(op_mode_prompt) + if args.no_vpp: + # remove VPP tests + c.sendline('sudo rm -f /usr/libexec/vyos/tests/smoke/cli/test_vpp*') + c.expect(op_mode_prompt) if args.vyconf: c.sendline('sudo /usr/libexec/vyos/set_vyconf_backend.py --no-prompt &> /dev/null') @@ -837,6 +843,14 @@ try: # else, run configtest suite elif args.configtest: + 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 {{}} +') + 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.expect(op_mode_prompt) + log.info('Adding a legacy WireGuard default keypair for migrations') c.sendline('sudo mkdir -p /config/auth/wireguard/default') c.expect(op_mode_prompt) -- cgit v1.2.3 From a245f81e0628e2190e51cb863af5a506a8d1fec7 Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Wed, 2 Jul 2025 16:47:02 +0000 Subject: T7609: Smoketest add huge-page-size and huge-page-count arguments --- Makefile | 4 ++-- scripts/check-qemu-install | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) (limited to 'scripts/check-qemu-install') diff --git a/Makefile b/Makefile index 271d005f..49fdab52 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ test-interfaces: checkiso .PHONY: test-vpp .ONESHELL: test-vpp: checkiso - scripts/check-qemu-install --debug --configd --match="vpp" --smoketest --uefi --cpu 4 --memory 8 build/live-image-amd64.hybrid.iso + scripts/check-qemu-install --debug --configd --match="vpp" --smoketest --uefi --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1600 build/live-image-amd64.hybrid.iso .PHONY: testc .ONESHELL: @@ -51,7 +51,7 @@ testc: checkiso .PHONY: testcvpp .ONESHELL: testcvpp: checkiso - scripts/check-qemu-install --debug --configd --match="vpp" --cpu 4 --memory 8 --configtest build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug --configd --match="vpp" --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1600 --configtest build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS)) .PHONY: testraid .ONESHELL: diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index e673e3e3..8d6dbece 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -101,6 +101,8 @@ parser.add_argument('--vyconf', help='Execute testsuite with vyconfd', action='s default=False) parser.add_argument('--no-vpp', help='Execute testsuite without VPP tests', action='store_true', default=False) +parser.add_argument('--huge-page-size', help='Huge page size (e.g., 2M, 1G)', type=str) +parser.add_argument('--huge-page-count', help='Number of huge pages to allocate', type=int) args = parser.parse_args() @@ -413,6 +415,22 @@ try: exit(1) ################################################# + # Configure boot options if required + ################################################# + if args.huge_page_size and args.huge_page_count: + c.sendline('configure') + c.expect(cfg_mode_prompt) + c.sendline(f'set system option kernel memory hugepage-size {args.huge_page_size} hugepage-count {args.huge_page_count}') + c.expect(cfg_mode_prompt) + c.sendline('set system option kernel disable-mitigations') + c.expect(cfg_mode_prompt) + c.sendline('commit') + c.expect(cfg_mode_prompt) + c.sendline('save') + c.expect(cfg_mode_prompt) + c.sendline('exit') + c.expect(op_mode_prompt) + ################################################# # Installing into VyOS system ################################################# log.info('Starting installer') @@ -528,6 +546,14 @@ try: loginVM(c, log) + ################################################# + # Boot options require a reboot + ################################################# + if args.huge_page_size and args.huge_page_count: + log.info('Rebooting to apply kernel boot options') + c.sendline('reboot now') + loginVM(c, log) + ################################################ # Always load the WiFi simulation module ################################################ @@ -572,6 +598,12 @@ try: c.expect(op_mode_prompt) c.sendline('show system memory') c.expect(op_mode_prompt) + c.sendline('show system memory detail | no-more') + c.expect(op_mode_prompt) + c.sendline('show configuration commands | match kernel') + c.expect(op_mode_prompt) + c.sendline('cat /proc/cmdline') + c.expect(op_mode_prompt) c.sendline('show version all | grep -e "vpp" -e "vyos-1x"') c.expect(op_mode_prompt) -- cgit v1.2.3 From 7807f0d0e86d866d993c5d31292e3206e4e88cfd Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Thu, 3 Jul 2025 06:05:06 +0000 Subject: T7606: Add include and exclude mode for match check-install qemu --- scripts/check-qemu-install | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'scripts/check-qemu-install') 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') -- cgit v1.2.3