diff options
author | Christian Breunig <christian@breunig.cc> | 2024-09-06 20:21:14 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-09-07 21:32:34 +0200 |
commit | 7f23b57b190ca1436a006af271586e733ed3f48d (patch) | |
tree | bd7436126d7634d031a09a6df455ee7c03b6296e | |
parent | fd7d1d0d208f5857d84f1bc48577ff775a67b823 (diff) | |
download | vyos-build-7f23b57b190ca1436a006af271586e733ed3f48d.tar.gz vyos-build-7f23b57b190ca1436a006af271586e733ed3f48d.zip |
Testsuite: T861: eject installation media CD-ROM over powercycle
When moving to UEFI and secure-boot it's better to just reboot the system
for Machine Owner Key installation, then powercycling the machine.
This commit will use `reboot now` over `poweroff` after base system installation
and boot into installed image for smoketest handling.
-rwxr-xr-x | scripts/check-qemu-install | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index fe781b60..a9fea6ac 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -160,6 +160,7 @@ def get_qemu_cmd(name, enable_kvm, enable_uefi, disk_img, raid=None, iso_img=Non {cpu} \ {cdrom} \ {kvm} \ + -monitor unix:/tmp/qemu-monitor-socket-{disk_img},server,nowait \ -netdev user,id=n0,net=192.0.2.0/24,dhcpstart=192.0.2.101,dns=192.0.2.10 -device virtio-net-pci,netdev=n0,mac={macbase}:00,romfile="" \ -netdev user,id=n1 -device virtio-net-pci,netdev=n1,mac={macbase}:01,romfile="" \ -netdev user,id=n2 -device virtio-net-pci,netdev=n2,mac={macbase}:02,romfile="" \ @@ -363,14 +364,20 @@ try: c.expect('\nWhich file would you like as boot config?.*') c.sendline('') - log.info('system installed, shutting down') + c.expect(op_mode_prompt) + log.info('system installed, rebooting') + c.sendline('reboot now') ################################################# - # Powering down installer + # Removing CD installation media ################################################# - shutdownVM(c, log, 'Shutting down installation system') - c.close() + time.sleep(2) + log.info('eject installation media') + os.system(f'echo "eject -f drive-cd1" | socat - unix-connect:/tmp/qemu-monitor-socket-{args.disk}') + ################################################# + # Powering down installer + ################################################# if args.tpmtest: tpm_process = start_swtpm() @@ -378,9 +385,6 @@ try: # Booting installed system ################################################# log.info('Booting installed system') - cmd = get_qemu_cmd('TESTVM', kvm, args.uefi, args.disk, diskname_raid, tpm=args.tpmtest) - log.debug(f'Executing command: {cmd}') - c = pexpect.spawn(cmd, logfile=stl) ################################################# # Logging into VyOS system @@ -412,17 +416,16 @@ try: # Basic Configmode/Opmode switch ################################################# log.info('Basic CLI configuration mode test') + kernel_flavor = toml_loads(Path('data/defaults.toml').read_text()).get('kernel_flavor') + c.sendline('configure') c.expect(cfg_mode_prompt) c.sendline('exit') c.expect(op_mode_prompt) c.sendline('show version') c.expect(op_mode_prompt) - c.sendline('show version kernel') - kernel_flavor = toml_loads(Path('data/architectures/amd64.toml').read_text()).get('kernel_flavor') c.expect(f'{vyos_defaults["kernel_version"]}-{kernel_flavor}') - c.expect(op_mode_prompt) c.sendline('show version frr') c.expect(op_mode_prompt) |