Skip to content

Commit 4fbb4a2

Browse files
committed
Add locator support for OpenShift Virtualization (SatelliteQE#2327)
(cherry picked from commit 21a03d0)
1 parent 34e43ae commit 4fbb4a2

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

airgun/views/computeresource.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ class LibvirtProviderForm(View):
9595
display_type = Select(id='compute_resource_display_type')
9696
console_passwords = Checkbox(id='compute_resource_set_console_password')
9797

98+
@provider_content.register('OpenShift Virtualization')
99+
class OCPVProviderForm(View):
100+
hostname = TextInput(id='compute_resource_hostname')
101+
api_port = TextInput(id='compute_resource_api_port')
102+
namespace = TextInput(id='compute_resource_namespace')
103+
token = TextInput(id='compute_resource_password')
104+
ca_cert = TextInput(id='compute_resource_ca_cert')
105+
98106
@provider_content.register('RHEL OpenStack Platform')
99107
class OpenStackProviderForm(View):
100108
url = TextInput(id='compute_resource_url')

airgun/views/host.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ class BridgeForm(View):
193193
# Compute resource attributes
194194
network_type = FilteredDropdown(id='_compute_attributes_type')
195195
network = FilteredDropdown(id='_compute_attributes_bridge')
196+
ocpv_network = FilteredDropdown(id='_compute_attributes_network')
197+
cni_provider = FilteredDropdown(id='_compute_attributes_cni_provider')
196198
nic_type = FilteredDropdown(id='_compute_attributes_model')
197199

198200
def after_fill(self, was_change):
@@ -391,6 +393,36 @@ class operating_system(SatTab):
391393
image = FilteredDropdown(id='azure_rm_image_id')
392394
root_password = TextInput(id='host_root_pass')
393395

396+
@provider_content.register('OpenShift Virtualization')
397+
class OCPVResourceForm(View):
398+
@View.nested
399+
class virtual_machine(SatTab):
400+
TAB_NAME = 'Virtual Machine'
401+
cpus = TextInput(id='host_compute_attributes_cpu_cores')
402+
memory = TextInput(id='host_compute_attributes_memory')
403+
startup = Checkbox(id='host_compute_attributes_start')
404+
405+
@View.nested
406+
class storage(SatTab):
407+
TAB_NAME = 'Virtual Machine'
408+
add_volume = Text("//a[@class = 'info add_nested_fields btn btn-primary']")
409+
storage_volumes = (
410+
".//fieldset[@id='storage_volumes']/div/div[contains(@class,'removable-item')]"
411+
)
412+
storage_class = FilteredDropdown(locator=storage_volumes)
413+
size = TextInput(locator=f"{storage_volumes}//input[contains(@id, 'capacity')]")
414+
bootable = Checkbox(
415+
locator=f"{storage_volumes}//div[3]//input[contains(@onclick, 'bootableRadio(this)')]"
416+
)
417+
418+
def before_fill(self, values=None):
419+
self.add_volume.click()
420+
421+
@View.nested
422+
class operating_system(SatTab):
423+
TAB_NAME = 'Operating System'
424+
provision_method = Checkbox(id='host_provision_method_image')
425+
394426
@View.nested
395427
class operating_system(SatTab):
396428
TAB_NAME = 'Operating System'

0 commit comments

Comments
 (0)