Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCIe, Slots in pcie-root numbered [1,31] #4729

Merged
merged 1 commit into from
Feb 28, 2023

Conversation

vasekhodina
Copy link

This PR adds automation of tests where pcie-root-port controllers should have target with slot numbered from 1 to 31 (in hexadecimal numbers).

VIRT-55414

@vasekhodina
Copy link
Author

Depends on #4709

@vasekhodina vasekhodina force-pushed the LIBVIRTAT-13924 branch 6 times, most recently from d4f1d32 to 3143809 Compare February 15, 2023 11:25
@dzhengfy
Copy link
Contributor

#4709 was merged. Please rebase. Thanks.

@vasekhodina vasekhodina force-pushed the LIBVIRTAT-13924 branch 4 times, most recently from 061b796 to d5ffd30 Compare February 21, 2023 17:16
@vasekhodina
Copy link
Author

New tests pass on RHEL 9.2, with the exception of one:

]# avocado run --vt-type libvirt pcie_root_port_controller.positive_test.address_slot_too_low pcie_root_port_controller.positive_test.address_slot_min_value pcie_root_port_controller.positive_test.address_slot_max_value pcie_root_port_controller.negative_test.address_slot_too_high
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.
JOB ID     : 234c82fc299167dc9e01e60c606b7abf89b13126
JOB LOG    : /var/lib/avocado/job-results/job-2023-02-21T12.15-234c82f/job.log
 (1/4) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_too_low: STARTED
 (1/4) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_too_low: PASS (12.68 s)
 (2/4) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_min_value: STARTED
 (2/4) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_min_value: PASS (15.80 s)
 (3/4) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_max_value: STARTED
 (3/4) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_max_value: FAIL: error: Failed to define domain from /var/tmp/xml_utils_temp_223kau3v.xml\nerror: unsupported configuration: Unknown model type 'virtio-scsi'\n (12.91 s)
 (4/4) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.address_slot_too_high: STARTED
 (4/4) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.address_slot_too_high: PASS (12.24 s)
RESULTS    : PASS 3 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/lib/avocado/job-results/job-2023-02-21T12.15-234c82f/results.html
JOB TIME   : 57.12 s

The exception is caused by avocado-vt issue avocado-framework/avocado-vt#3630

@vasekhodina vasekhodina marked this pull request as ready for review February 21, 2023 17:22
@vasekhodina
Copy link
Author

@dzhengfy Please review.

wipe_devices = "yes"
test_define_only = "yes"
controller_address = '{"type": "pci", "domain": "0x0000", "bus": "0x00", "slot": "0x03", "function":"0x0"}'
- address_slot_max_value:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this test because sata controller now is automatically inserted by libvirt. We need not to test it explicitely.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? Sata is being set up here to test address slot 0x1f. Because pcie-root-port cannot have slot 0x1f. So we're testing the slot not sata controller.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the manual case, I saw the test scenario is to test with sata controller attached to pcie-root. Currently this controller is already added by libvirt by default. The pci address is same as you defined. So when I test with your pr, I got double use for that adress. You can check your vm in your environment.

- address_slot_too_high:
wipe_devices = "yes"
test_define_only = "yes"
controller_address = '{"type": "pci", "domain": "0x0000", "bus": "0x02", "slot": "0x20", "function":"0x0"}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a checking for failure_message


if test_define_only:
return

index = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 34 , and 35, why not directly to use index = 2?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Index should be 1. The line below should be deleted. Fixed.

"controller_index": index,
'controller_target': target,
"controller_addr": str(address)}
print("contr_dict" + str(contr_dict))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line or replace with LOG

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

contr_object = libvirt.create_controller_xml(contr_dict)
print(contr_object)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line or replace with LOG

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

contr_object = libvirt.create_controller_xml(contr_dict)
print(contr_object)
if index == 0:
contr_object.index = 0 # Workaround for non-working avocado-vt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove above 2 lines

@dzhengfy
Copy link
Contributor

Could you please provide all test results for avocado run --vt-type libvirt pcie_root_port_controller

if not check_slot_in_controller(vmxml, index, expected_value,
slot_equal_after_define):
test.fail("Controller slot doesn't have the"
"expected value of %s.", expected_value)
else:
libvirt.check_exit_status(cmd_result, status_error)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move line 139 to 147 to Line 150, like:

if failure_message:
        libvirt.check_result(cmd_result, [failure_message])
else:
        libvirt.check_exit_status(cmd_result, status_error)
if check_slot:
        vmxml = vm_xml.VMXML.new_from_inactive_dumpxml(
        params.get("main_vm", "avocado-vt-vm1"))
        expected_value = address["slot"]
        if not check_slot_in_controller(vmxml, index, expected_value,
                                                              slot_equal_after_define):
            test.fail("Controller slot doesn't have the"
                      "expected value of %s.", expected_value)

# We want to default to None so we can differentiate between None and 0
controller_index = params.get("controller_index", None)
model = params.get("controller_model")
if controller_index is not None:
if controller_index == "xxx":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xxx? What's this? Did you test it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is related to test pcie_root_port_controller.negative_test.controller_index_invalid. It is related to another polarion case. Check the configuration file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is random and customized. So to make it more clear, we can also use some customized value, like test, aaa...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.xxx seems too inofficial. Usually we use a meaningful value like invalid_index

@vasekhodina
Copy link
Author

Test results from RHEL 9.2:

# avocado run --vt-type libvirt pcie_root_port_controller
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.
JOB ID     : 609099bc681127ee4847600e212565700a3d8eef
JOB LOG    : /var/lib/avocado/job-results/job-2023-02-22T09.04-609099b/job.log
 (01/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.controllers_different_chassis_same_port: STARTED
 (01/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.controllers_different_chassis_same_port: PASS (18.22 s)
 (02/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_too_low: STARTED
 (02/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_too_low: PASS (21.67 s)
 (03/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_min_value: STARTED
 (03/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_min_value: PASS (12.64 s)
 (04/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_invalid: STARTED
 (04/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_invalid: PASS (15.90 s)
 (05/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_wrong_number: STARTED
 (05/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_wrong_number: FAIL: Expect should fail with one of ['Invalid PCI address .* slot must be <= 0'], but succeeded: Domain 'avocado-vt-vm1' defined from /var/tmp/xml_utils_temp_ca1mkn28.xml\n\n\n (22.17 s)
 (06/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_same_port: STARTED
 (06/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_same_port: PASS (17.03 s)
 (07/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_different_port: STARTED
 (07/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_different_port: PASS (17.32 s)
 (08/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.model_name_invalid: STARTED
 (08/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.model_name_invalid: PASS (14.72 s)
 (09/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_equals_address_bus: STARTED
 (09/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_equals_address_bus: PASS (14.85 s)
 (10/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_less_than_address_bus: STARTED
 (10/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_less_than_address_bus: PASS (14.81 s)
 (11/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_zero: STARTED
 (11/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_zero: PASS (21.24 s)
 (12/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_too_high: STARTED
 (12/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_too_high: PASS (14.05 s)
 (13/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_invalid: STARTED
 (13/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_invalid: PASS (14.01 s)
 (14/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_less_than_valid: STARTED
 (14/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_less_than_valid: PASS (17.55 s)
 (15/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_greater_than_valid: STARTED
 (15/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_greater_than_valid: PASS (14.78 s)
 (16/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_invalid: STARTED
 (16/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_invalid: PASS (15.32 s)
 (17/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.address_slot_too_high: STARTED
 (17/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.address_slot_too_high: PASS (19.51 s)
RESULTS    : PASS 16 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/lib/avocado/job-results/job-2023-02-22T09.04-609099b/results.html
JOB TIME   : 295.68 s

pcie_root_port_controller.negative_test.device_slot_wrong_number fails by virsh define being successful when failure is expected. However when I check the VM XML the related part is set up correctly:

<interface type="network"><source network="default" /><address type="pci" bus="0x10" **slot="0x1"** /></interface>

So I think the error is in libvirt and not the script.

@dzhengfy
Copy link
Contributor

@vasekhodina For that failed case device_slot_wrong_number, please add for that interface device.

@@ -125,14 +135,51 @@ def check_define_vm(vmxml, params):
libvirt.check_result(cmd_result, [failure_message])
else:
libvirt.check_exit_status(cmd_result, status_error)
if check_slot:
libvirt.check_exit_status(cmd_result, status_error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this duplcated with line 137?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libvirt.check_exit_status() will be executed twice when check_slot is True.

@vasekhodina
Copy link
Author

All tests pass now on RHEL 9.2:

# avocado run --vt-type libvirt pcie_root_port_controller
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.
JOB ID     : 4031be797dc0ac17f2a0f5e554805c78469e02c3
JOB LOG    : /var/lib/avocado/job-results/job-2023-02-23T07.10-4031be7/job.log
 (01/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.controllers_different_chassis_same_port: STARTED
 (01/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.controllers_different_chassis_same_port: PASS (18.51 s)
 (02/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_too_low: STARTED
 (02/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_too_low: PASS (21.93 s)
 (03/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_min_value: STARTED
 (03/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_min_value: PASS (12.68 s)
 (04/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_invalid: STARTED
 (04/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_invalid: PASS (16.94 s)
 (05/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_wrong_number: STARTED
 (05/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_wrong_number: PASS (16.02 s)
 (06/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_same_port: STARTED
 (06/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_same_port: PASS (26.25 s)
 (07/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_different_port: STARTED
 (07/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_different_port: PASS (17.63 s)
 (08/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.model_name_invalid: STARTED
 (08/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.model_name_invalid: PASS (28.92 s)
 (09/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_equals_address_bus: STARTED
 (09/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_equals_address_bus: PASS (14.28 s)
 (10/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_less_than_address_bus: STARTED
 (10/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_less_than_address_bus: PASS (15.40 s)
 (11/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_zero: STARTED
 (11/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_zero: PASS (24.81 s)
 (12/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_too_high: STARTED
 (12/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_too_high: PASS (13.09 s)
 (13/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_invalid: STARTED
 (13/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_invalid: PASS (13.07 s)
 (14/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_less_than_valid: STARTED
 (14/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_less_than_valid: PASS (14.20 s)
 (15/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_greater_than_valid: STARTED
 (15/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_greater_than_valid: PASS (14.46 s)
 (16/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_invalid: STARTED
 (16/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_invalid: PASS (14.54 s)
 (17/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.address_slot_too_high: STARTED
 (17/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.address_slot_too_high: PASS (11.95 s)
RESULTS    : PASS 17 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/lib/avocado/job-results/job-2023-02-23T07.10-4031be7/results.html
JOB TIME   : 304.87 s

@vasekhodina vasekhodina force-pushed the LIBVIRTAT-13924 branch 3 times, most recently from aaa4f93 to 63cf311 Compare February 27, 2023 08:39
@vasekhodina
Copy link
Author

Tests pass on RHEL 8.8:
image

@@ -190,6 +237,19 @@ def check_vm_start(vm, params, **virsh_options):
libvirt.check_exit_status(cmd_result, status_error)


def wipe_pcie_root_ports(vmxml):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use wipe_pcie_controllers(vmxml)? Because I think vmxml.remove_all_device_by_type("controller") in this function is to remove all controllers but not pcie-root-port.

index = 0
contr_dict = {"type": "pci", "model": "pcie-root", "index": index}
libvirt_vmxml.modify_vm_device(vmxml, "controller", contr_dict, index)
wipe_pcie_root_ports(vmxml)

if test_define_only:
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, what does this step do?

# We want to default to None so we can differentiate between None and 0
controller_index = params.get("controller_index", None)
model = params.get("controller_model")
if controller_index is not None:
if controller_index == "xxx":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is random and customized. So to make it more clear, we can also use some customized value, like test, aaa...

failure_message = "Invalid PCI address .* slot must be <= 0"
- controllers_same_chassis_same_port:
second_controller_model = "pcie-root-port"
second_controller_target = "{'chassis':1,'port':'0x8'}"
index_offset = 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here it means we create a pcie controller with "index='3'" in python file, and the "index='2'" will be generated automatically? For controllers_same_chassis_same_port, which codes means it has the same port?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See line 6 controller_target = '{"chassis":1,"port":"0x8"}'

@vasekhodina
Copy link
Author

Test results from RHEL 8.8:

# avocado run --vt-type libvirt pcie_root_port_controller
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.
JOB ID     : 7cfcde63fc2f7d67e9e89b2884f49fab20217abb
JOB LOG    : /var/lib/avocado/job-results/job-2023-02-27T10.18-7cfcde6/job.log
 (01/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.controllers_different_chassis_same_port: STARTED
 (01/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.controllers_different_chassis_same_port: PASS (6.98 s)
 (02/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_too_low: STARTED
 (02/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_too_low: PASS (5.33 s)
 (03/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_min_value: STARTED
 (03/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.positive_test.address_slot_min_value: PASS (5.45 s)
 (04/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_invalid: STARTED
 (04/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_invalid: PASS (5.18 s)
 (05/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_wrong_number: STARTED
 (05/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.device_slot_wrong_number: PASS (5.25 s)
 (06/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_same_port: STARTED
 (06/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_same_port: PASS (6.59 s)
 (07/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_different_port: STARTED
 (07/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controllers_same_chassis_different_port: PASS (6.52 s)
 (08/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.model_name_invalid: STARTED
 (08/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.model_name_invalid: PASS (4.94 s)
 (09/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_equals_address_bus: STARTED
 (09/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_equals_address_bus: PASS (5.15 s)
 (10/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_less_than_address_bus: STARTED
 (10/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.index_less_than_address_bus: PASS (5.14 s)
 (11/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_zero: STARTED
 (11/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_zero: PASS (5.00 s)
 (12/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_too_high: STARTED
 (12/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_too_high: PASS (4.99 s)
 (13/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_invalid: STARTED
 (13/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.controller_index_invalid: PASS (5.02 s)
 (14/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_less_than_valid: STARTED
 (14/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_less_than_valid: CANCEL: Chassis value -1 behaves incorrectly in libvirt version less than 8.8.0 (4.35 s)
 (15/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_greater_than_valid: STARTED
 (15/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_greater_than_valid: PASS (5.00 s)
 (16/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_invalid: STARTED
 (16/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.chassis_invalid: PASS (5.01 s)
 (17/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.address_slot_too_high: STARTED
 (17/17) type_specific.io-github-autotest-libvirt.pcie_root_port_controller.negative_test.address_slot_too_high: PASS (5.20 s)
RESULTS    : PASS 16 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 1
JOB HTML   : /var/lib/avocado/job-results/job-2023-02-27T10.18-7cfcde6/results.html
JOB TIME   : 102.83 s

Copy link
Contributor

@dzhengfy dzhengfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others LGTM

@@ -190,6 +238,19 @@ def check_vm_start(vm, params, **virsh_options):
libvirt.check_exit_status(cmd_result, status_error)


def wipe_pcie_controllers(vmxml):
"""
Function that removes all pcie-root-port devices from VM XML
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the docstring also needs update.

# We want to default to None so we can differentiate between None and 0
controller_index = params.get("controller_index", None)
model = params.get("controller_model")
if controller_index is not None:
if controller_index == "xxx":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.xxx seems too inofficial. Usually we use a meaningful value like invalid_index

This commit adds automation of tests where pcie-root-port controllers
should have target with slot numbered from 1 to 31 (in hexadecimal
numbers).

VIRT-55414
@dzhengfy dzhengfy merged commit 08c5065 into autotest:master Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants