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

add case for invalid dimm device config #5263

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

nanli1
Copy link
Contributor

@nanli1 nanli1 commented Nov 9, 2023

VIRT-299046: Verify error messages prompt with invalid memory device configs

Signed-off-by: nanli [email protected]

RHEL9& RHEL 8 + x86


 avocado run --vt-type libvirt --test-runner=runner --vt-machine-type q35 memory.devices.invalid_dimm

 (1/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.exceed_slot: PASS (15.26 s)
 (2/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.max_addr: PASS (14.97 s)
 (3/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.unexisted_node: PASS (26.26 s)
 (4/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.unexisted_nodemask: PASS (14.41 s)
 (5/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.invalid_pagesize: PASS (14.43 s)
 (6/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.invalid_addr_type: PASS (16.12 s)
RESULTS    : PASS 6 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0


PASSED on aarch64+rhel9

avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio    memory.devices.invalid_dimm
 (1/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.exceed_slot: PASS (11.76 s)
 (2/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.max_addr: PASS (12.12 s)
 (3/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.unexisted_node: PASS (12.20 s)
 (4/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.unexisted_nodemask: PASS (11.34 s)
 (5/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.invalid_pagesize: PASS (11.84 s)
 (6/6) type_specific.io-github-autotest-libvirt.memory.devices.invalid_dimm.with_numa.invalid_addr_type: PASS (12.50 s)

@nanli1
Copy link
Contributor Author

nanli1 commented Nov 9, 2023

modular_redesign

@nanli1 nanli1 force-pushed the add_case_for_invalid_dimm_config branch from 8c5fd47 to eeeaa4c Compare November 9, 2023 10:06
@nanli1 nanli1 marked this pull request as draft November 16, 2023 04:43
@nanli1 nanli1 marked this pull request as ready for review November 16, 2023 05:17
@nanli1 nanli1 marked this pull request as draft November 17, 2023 02:00
@nanli1 nanli1 marked this pull request as ready for review November 19, 2023 01:21
@nanli1 nanli1 marked this pull request as draft November 20, 2023 06:43
@nanli1 nanli1 marked this pull request as ready for review November 22, 2023 00:17
@nanli1 nanli1 marked this pull request as draft November 23, 2023 02:03
@nanli1 nanli1 force-pushed the add_case_for_invalid_dimm_config branch from 83b6f4d to cf9ec7f Compare November 23, 2023 02:20
@nanli1 nanli1 marked this pull request as ready for review November 23, 2023 02:22
@nanli1 nanli1 force-pushed the add_case_for_invalid_dimm_config branch from cf9ec7f to d7549c0 Compare November 23, 2023 04:13
Copy link
Contributor

@cliping cliping 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

else:
page_size = process.run(pagesize_cmd, ignore_status=True,
shell=True).stdout_text.strip()
return int(page_size)
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to add docstring for return value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks liping ,Updated

"""
mem_obj = memory.Memory()
mem_obj.setup_attrs(**eval(mem_dict))
return mem_obj
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks liping ,Updated

def define_guest(test, params, page_size):
"""
Define guest with specific
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Miss docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks liping ,Updated

@nanli1 nanli1 force-pushed the add_case_for_invalid_dimm_config branch from d7549c0 to 4857fc9 Compare November 27, 2023 03:40
@nanli1 nanli1 requested a review from cliping November 27, 2023 05:51
@nanli1 nanli1 force-pushed the add_case_for_invalid_dimm_config branch from 4857fc9 to e3de46f Compare November 27, 2023 06:04
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

original_xml.setup_attrs(**vm_attrs)
test.log.debug("Define vm by '%s' \n", original_xml)
original_xml.sync()
virsh.start(vm_name, debug=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

ignore_status=False is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks dzheng, Updated

@nanli1 nanli1 force-pushed the add_case_for_invalid_dimm_config branch from e3de46f to 5a382c7 Compare December 5, 2023 05:51
@nanli1 nanli1 requested a review from dzhengfy December 5, 2023 05:52
define_error = "Invalid value for attribute 'type' in element 'address': '${addr_type}'"
aarch64:
define_error = "unknown address type '${addr_type}'"
addr_dict = "'address':{'attrs': {'type': '${addr_type}', 'base': '${addr_base}', 'slot': '${slot}'}}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe move those 3 lines to just follow up line 19

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks chunfu, But the addr_dict has some variables in the lines after L19 , such as ${addr_type},So I add addr_dict here .

2.memory setting: with numa
"""

def setup_test():
Copy link
Contributor

Choose a reason for hiding this comment

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

since previously most of method were moved out of scope of run(test, params, env).
Can setup_test(), run_test() and teardown_test() be moved out ? and just put above def run(test, params, env):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, chunfu , Thanks your advice. Have we confirmed we should do like that? I think both are OK.

@nanli1 nanli1 requested a review from chunfuwen December 8, 2023 02:32
    VIRT-299046: Verify error messages prompt with invalid memory device configs
Signed-off-by: nanli <[email protected]>
@nanli1 nanli1 force-pushed the add_case_for_invalid_dimm_config branch from 5a382c7 to 6fa5057 Compare December 11, 2023 05:21
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.

LGTM

Copy link
Contributor

@chunfuwen chunfuwen left a comment

Choose a reason for hiding this comment

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

lgtm

@chunfuwen chunfuwen merged commit c5a4308 into autotest:master Dec 13, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants