@@ -174,6 +174,20 @@ def create_backup_vms(self, pool=None):
174174 self .loop .run_until_complete (testvm4 .create_on_disk (pool = pool ))
175175 vms .append (testvm4 )
176176
177+ vmname = self .make_vm_name ("dvm" )
178+ self .log .debug ("Creating %s" % vmname )
179+ testvm5 = self .app .add_new_vm (
180+ qubes .vm .appvm .AppVM ,
181+ name = vmname ,
182+ template = testvm3 ,
183+ label = "red" ,
184+ template_for_dispvms = True ,
185+ )
186+ self .loop .run_until_complete (testvm4 .create_on_disk (pool = pool ))
187+ testvm5 .features ["preload-dispvm-max" ] = 0
188+ testvm5 .features ["preload-dispvm" ] = ""
189+ vms .append (testvm5 )
190+
177191 self .app .save ()
178192
179193 return vms
@@ -318,6 +332,7 @@ def get_vms_info(self, vms):
318332 vm_info = {
319333 "properties" : {},
320334 "default" : {},
335+ "features" : {},
321336 "devices" : {},
322337 }
323338 for prop in (
@@ -343,6 +358,8 @@ def get_vms_info(self, vms):
343358 continue
344359 vm_info ["properties" ][prop ] = str (getattr (vm , prop ))
345360 vm_info ["default" ][prop ] = vm .property_is_default (prop )
361+ for feature , value in vm .features .items ():
362+ vm_info ["features" ][feature ] = value
346363 for dev_class in vm .devices .keys ():
347364 vm_info ["devices" ][dev_class ] = {}
348365 for ass in vm .devices [dev_class ].get_assigned_devices ():
@@ -379,6 +396,20 @@ def assertCorrectlyRestored(self, vms_info, orig_hashes):
379396 vm_name , prop
380397 ),
381398 )
399+ for feature in vm_info ["features" ]:
400+ if (
401+ feature .startswith ("preload-dispvm" )
402+ and feature != "preload-dispvm-max"
403+ ):
404+ self .assertIsNone (restored_vm .features .get (feature , None ))
405+ continue
406+ self .assertEqual (
407+ vm_info ["features" ][feature ],
408+ restored_vm .features .get (feature ),
409+ "VM {} - feature {} not properly restored" .format (
410+ vm_name , feature
411+ ),
412+ )
382413 for dev_class in vm_info ["devices" ]:
383414 for dev in vm_info ["devices" ][dev_class ]:
384415 found = False
0 commit comments