@@ -92,12 +92,44 @@ def test_install_nested_821_uefi(self, iso_remaster, create_vms):
92
92
wait_for (host_vm .is_halted , "Wait for host VM halted" )
93
93
host_vm .eject_cd ()
94
94
95
- # FIXME: make a snapshot here
95
+ except Exception as e :
96
+ logging .critical ("caught exception %s" , e )
97
+ # wait_for(lambda: False, 'Wait "forever"', timeout_secs=100*60)
98
+ host_vm .shutdown (force = True )
99
+ raise
100
+ except KeyboardInterrupt :
101
+ logging .warning ("keyboard interrupt" )
102
+ # wait_for(lambda: False, 'Wait "forever"', timeout_secs=100*60)
103
+ host_vm .shutdown (force = True )
104
+ raise
105
+
106
+ # record this state
107
+ # FIXME move to fixture
108
+ # FIXME where to store?
109
+ host_vm .host .ssh (["rm -f test_install_nested_821_uefi-vm1.xva" ])
110
+ host_vm .export ("test_install_nested_821_uefi-vm1.xva" , "zstd" )
111
+
112
+ @pytest .mark .vm_definitions (
113
+ dict (name = "vm 1" ,
114
+ image = "test_install_nested_821_uefi-vm1.xva"
115
+ ))
116
+ def test_firstboot_nested_821_uefi (self , create_vms ):
117
+ assert len (create_vms ) == 1
118
+ host_vm = create_vms [0 ]
96
119
120
+ vif = host_vm .vifs ()[0 ]
121
+ mac_address = vif .param_get ('MAC' )
122
+ logging .info ("Host VM has MAC %s" , mac_address )
123
+
124
+ try :
97
125
# FIXME: evict MAC from ARP cache first?
98
126
host_vm .start ()
99
127
wait_for (host_vm .is_running , "Wait for host VM running" )
100
128
129
+ # catch host-vm IP address
130
+ wait_for (lambda : pxe .arp_addresses_for (mac_address ),
131
+ "Wait for DHCP server to see Host VM in ARP tables" ,
132
+ timeout_secs = 10 * 60 )
101
133
ips = pxe .arp_addresses_for (mac_address )
102
134
logging .info ("Host VM has IPs %s" , ips )
103
135
assert len (ips ) == 1
0 commit comments