From bdc7dfc00ce375517ec8f679019f837dfeeee62d Mon Sep 17 00:00:00 2001 From: jamepark4 Date: Mon, 10 Jun 2024 14:01:33 -0400 Subject: [PATCH] Use sudo when gather compute id information Downstream computes are accessed via cloud-admin and does not have access to /var/lib/nova/compute_id. Enable check via sudo to gather compute uuid info. Also remove trailing newline cat output of /var/lib/nova/compute_id file before doing assert. Change-Id: I6683727c31bd5a732ee463c72bc71d758ed37888 --- whitebox_tempest_plugin/api/compute/test_compute_id.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/whitebox_tempest_plugin/api/compute/test_compute_id.py b/whitebox_tempest_plugin/api/compute/test_compute_id.py index b59e14a5..1739a724 100644 --- a/whitebox_tempest_plugin/api/compute/test_compute_id.py +++ b/whitebox_tempest_plugin/api/compute/test_compute_id.py @@ -43,7 +43,9 @@ class TestStableCpuId(base.BaseWhiteboxComputeTest): for hypervisor in hypervisors: name = hypervisor['hypervisor_hostname'] ssh_client = clients.SSHClient(name) - uuid_on_disk = ssh_client.execute(f'cat {compute_id_path}') + uuid_on_disk = ssh_client.execute(f'cat {compute_id_path}', + sudo=True) + uuid_on_disk = uuid_on_disk.rstrip() self.assertEqual( hypervisor['id'], uuid_on_disk,