@@ -65,6 +65,15 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
6565 create_and_run = False ,
6666 pixel_test_tag = "url" ))
6767
68+ # boot argument check
69+ runner .cancelDialogTest (TestMachinesCreate .VmDialog (self , sourceType = 'url' ,
70+ location = config .VALID_URL ,
71+ memory_size = 128 , memory_size_unit = 'MiB' ,
72+ os_name = config .FEDORA_28 ,
73+ extra_arguments = "foo=bar" ,
74+ create_and_run = False ,
75+ pixel_test_tag = "extra-args-url" ))
76+
6877 # OS input check
6978 runner .checkOsInputTest (TestMachinesCreate .VmDialog (self ))
7079
@@ -514,6 +523,15 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
514523 os_name = config .FEDORA_28 ,
515524 os_short_id = config .FEDORA_28_SHORTID ))
516525
526+ # test with --extra-args
527+ runner .createDownloadAnOSTest (TestMachinesCreate .VmDialog (self , sourceType = 'os' ,
528+ expected_memory_size = 128 ,
529+ expected_storage_size = 128 ,
530+ os_name = config .FEDORA_28 ,
531+ os_short_id = config .FEDORA_28_SHORTID ,
532+ extra_arguments = "foo=bar" ,
533+ create_and_run = True ))
534+
517535 # name already used from a VM that is currently being created
518536 # https://bugzilla.redhat.com/show_bug.cgi?id=1780451
519537 runner .createDownloadAnOSTest (TestMachinesCreate .VmDialog (self , name = 'existing-name' , sourceType = 'os' ,
@@ -820,6 +838,20 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
820838 storage_pool = NEW_VOLUME_RAW ,
821839 create_and_run = True ,))
822840
841+ # test with --extra-args
842+ dialog = TestMachinesCreate .VmDialog (self , sourceType = 'file' ,
843+ name = "extra-args-file" ,
844+ location = config .TREE_FILE ,
845+ memory_size = 128 , memory_size_unit = 'MiB' ,
846+ storage_size = 128 , storage_size_unit = 'MiB' ,
847+ extra_arguments = "foo=bar" ,
848+ delete = False ,
849+ create_and_run = True )
850+ runner .createTest (dialog )
851+ testlib .wait (lambda : "--extra-args foo=bar" in self .machine .execute ("ps aux | grep '[v]irt-install'" ))
852+ runner ._deleteVm (dialog )
853+ runner .checkEnvIsEmpty ()
854+
823855 def testCreateImportDisk (self ):
824856 runner = TestMachinesCreate .CreateVmRunner (self )
825857 config = TestMachinesCreate .TestCreateConfig
@@ -898,6 +930,20 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
898930 storage_size = 128 , storage_size_unit = 'MiB' ,
899931 create_and_run = False ))
900932
933+ # test with --extra-args
934+ dialog = TestMachinesCreate .VmDialog (self , sourceType = 'url' ,
935+ name = "extra-args-url" ,
936+ location = config .TREE_URL ,
937+ memory_size = 128 , memory_size_unit = 'MiB' ,
938+ storage_size = 128 , storage_size_unit = 'MiB' ,
939+ extra_arguments = "foo=bar" ,
940+ delete = False ,
941+ create_and_run = True )
942+ runner .createTest (dialog )
943+ testlib .wait (lambda : "--extra-args foo=bar" in m .execute ("ps aux | grep '[v]irt-install'" ))
944+ runner ._deleteVm (dialog )
945+ runner .checkEnvIsEmpty ()
946+
901947 # This functionality works on debian only because of extra qemu-block-extra dep.
902948 # Check error is returned if dependency is missing
903949 if m .image .startswith ("debian" ):
@@ -944,6 +990,7 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
944990 PATH_WITH_SPACE = '/var/lib/libvirt/novell with spaces.iso'
945991 ISO_URL = 'https://archive.fedoraproject.org/pub/archive/fedora/linux/releases/28/Server/x86_64/os/images/boot.iso?foo=bar'
946992 TREE_URL = 'https://archive.fedoraproject.org/pub/archive/fedora/linux/releases/28/Server/x86_64/os'
993+ TREE_FILE = '/var/lib/libvirt/pub/archive/fedora/linux/releases/28/Server/x86_64/os/'
947994
948995 # LINUX can be filtered if 3 years old
949996 OLD_FILTERED_OS = 'Red Hat Enterprise Linux 8.3 (Ootpa)'
@@ -995,6 +1042,7 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
9951042 connection = "system" ,
9961043 offline_token = None ,
9971044 offline_token_autofilled = True ,
1045+ extra_arguments = None ,
9981046 pixel_test_tag = None ):
9991047
10001048 TestMachinesCreate .VmDialog .vmId += 1 # This variable is static - don't use self here
@@ -1049,6 +1097,7 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
10491097 self .name_generated = name_generated
10501098 self .offline_token = offline_token
10511099 self .offline_token_autofilled = offline_token_autofilled
1100+ self .extra_arguments = extra_arguments
10521101
10531102 self .pixel_test_tag = pixel_test_tag
10541103
@@ -1337,6 +1386,8 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
13371386 if self .user_login :
13381387 user_login = virt_install_cmd_out .split ("user-login=" , 1 )[1 ].split ("," )[0 ].rstrip ()
13391388 self .assertIn (user_login , self .user_login )
1389+ if self .extra_arguments :
1390+ self .assertIn (f"--extra-args { self .extra_arguments } " , virt_install_cmd_out )
13401391 return True
13411392
13421393 testlib .wait (virt_install_correct , tries = 180 )
@@ -1471,6 +1522,18 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
14711522 else :
14721523 b .wait_visible ("#create-and-run:not([aria-disabled=true])" )
14731524
1525+ if self .sourceType == "cloud" :
1526+ b .wait_not_present ("#extra-argument" )
1527+ else :
1528+ b .wait_visible ("#extra-argument" )
1529+
1530+ if self .extra_arguments :
1531+ if (self .sourceType in ["file" , "url" ] and not self .sourceType .endswith (".iso" )) \
1532+ or self .sourceType == "os" :
1533+ b .click ("#pf-tab-1-automation" )
1534+
1535+ b .set_input_text ("#extra-argument" , self .extra_arguments )
1536+
14741537 return self
14751538
14761539 def cancel (self , force = False ):
@@ -2090,7 +2153,8 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
20902153 if dialog .sourceType != 'cloud' :
20912154 self .browser .mouse (".pf-v6-c-tabs__list button[aria-disabled=true]:contains(Automation)" ,
20922155 "mouseenter" )
2093- tooltip_text = "Automated installs are only available when downloading an image or using cloud-init."
2156+ tooltip_text = "Automated installs are only available when downloading an image,"
2157+ tooltip_text += " an install tree or using cloud-init."
20942158 self .browser .wait_in_text ("div.pf-v6-c-tooltip__content" , tooltip_text )
20952159 self .browser .mouse (".pf-v6-c-tabs__list button[aria-disabled=true]:contains(Automation)" ,
20962160 "mouseleave" )
0 commit comments