Skip to content

Commit 0fe60ef

Browse files
committed
tests, net, kmp: Add client arg
As of its next release, openshift-python-wrapper will enforce passing client when working with cluster resources. openshift-virtualization-tests must align with this change. All calls in the code to openshift-python-wrapper resources should be updated to pass client arg. Since the KMP NS is created with an admin_client the VMs must be created with the same client - VMs under a namespace that is not created by a project admin require admin privileges. Signed-off-by: Anat Wax <[email protected]>
1 parent 8ad8e90 commit 0fe60ef

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/network/kubemacpool/conftest.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def restarted_vmi_b(vm_b):
251251

252252

253253
@pytest.fixture(scope="class")
254-
def disabled_ns_vm(disabled_ns, disabled_ns_nad, mac_pool):
254+
def disabled_ns_vm(admin_client, disabled_ns, disabled_ns_nad, mac_pool):
255255
networks = {disabled_ns_nad.name: disabled_ns_nad.name}
256256
name = f"{disabled_ns.name}-vm"
257257
with VirtualMachineForTests(
@@ -260,6 +260,7 @@ def disabled_ns_vm(disabled_ns, disabled_ns_nad, mac_pool):
260260
networks=networks,
261261
interfaces=networks.keys(),
262262
body=fedora_vm_body(name=name),
263+
client=admin_client,
263264
) as vm:
264265
mac_pool.append_macs(vm=vm)
265266
vm.start(wait=True)
@@ -269,7 +270,7 @@ def disabled_ns_vm(disabled_ns, disabled_ns_nad, mac_pool):
269270

270271

271272
@pytest.fixture(scope="class")
272-
def enabled_ns_vm(kmp_enabled_ns, enabled_ns_nad, mac_pool):
273+
def enabled_ns_vm(admin_client, kmp_enabled_ns, enabled_ns_nad, mac_pool):
273274
networks = {enabled_ns_nad.name: enabled_ns_nad.name}
274275
name = f"{kmp_enabled_ns.name}-vm"
275276
with VirtualMachineForTests(
@@ -278,6 +279,7 @@ def enabled_ns_vm(kmp_enabled_ns, enabled_ns_nad, mac_pool):
278279
networks=networks,
279280
interfaces=networks.keys(),
280281
body=fedora_vm_body(name=name),
282+
client=admin_client,
281283
) as vm:
282284
mac_pool.append_macs(vm=vm)
283285
vm.start(wait=True)
@@ -287,7 +289,7 @@ def enabled_ns_vm(kmp_enabled_ns, enabled_ns_nad, mac_pool):
287289

288290

289291
@pytest.fixture(scope="class")
290-
def no_label_ns_vm(no_label_ns, no_label_ns_nad, mac_pool):
292+
def no_label_ns_vm(admin_client, no_label_ns, no_label_ns_nad, mac_pool):
291293
networks = {no_label_ns_nad.name: no_label_ns_nad.name}
292294
name = f"{no_label_ns.name}-vm"
293295
with VirtualMachineForTests(
@@ -296,6 +298,7 @@ def no_label_ns_vm(no_label_ns, no_label_ns_nad, mac_pool):
296298
networks=networks,
297299
interfaces=networks.keys(),
298300
body=fedora_vm_body(name=name),
301+
client=admin_client,
299302
) as vm:
300303
mac_pool.append_macs(vm=vm)
301304
vm.start(wait=True)

0 commit comments

Comments
 (0)