-
Notifications
You must be signed in to change notification settings - Fork 168
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
guest_os_booting: add new case for backed nvram source #5164
Conversation
|
Depend on avocado-framework/avocado-vt#3764. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Others LGTM
|
||
def run(test, params, env): | ||
""" | ||
This case is to verify the ovmf backed nvram. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has extra spaces between 'ovmf' and 'backed'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Others LGTM
2) Start and boot the guest. | ||
3) Check the dumpxml and the label if necessary. | ||
""" | ||
def compare_guest_xml(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to pass 'vmxml' and 'os_attrs' as arguments of this function to make them as local variables, I think it's easy for others to understand it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the arguments to the function compare_guest_xml(vmxml, os_attrs).
09a249b
to
5a75618
Compare
test.fail("Configured os xml value {} doesn't match the" | ||
" entry {} in guest xml".format(os_attrs[key], current_os_attrs[key])) | ||
else: | ||
test.fail("Configured os attributes {} aren't existed in guest.".format(key)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:%s/aren't/don't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
if seclabel_label in label_result: | ||
test.log.info("Get expected nvram file label: {}".format(label_result)) | ||
else: | ||
test.fail("The nvram file label %{} is not expected".format(label_result)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove %?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
- with_selinux_seclabel: | ||
seclabel_model = "selinux" | ||
seclabel_label = "system_u:object_r:nvram_image_t:s0" | ||
nvram_dict = {'nvram_source': {'seclabels': [{'label': '${seclabel_label}', 'model': '${seclabel_model}', 'relabel': 'yes'}], 'attrs': {'file': '%s'}}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These ones(nvram_attrs and nvram_dict) are a bit similar, how about replacing 'nvram_dict' with 'nvram_source'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, a little similar. So changed to nvram_source.
Split the manual case to two cases: test the ovmf file backed nvram and test the ovmf nvram seclable. So update the script here.
|
This case is to verify the ovmf different backed nvram source. Now it only cover the file type. Signed-off-by: Meina Li <[email protected]>
This case is to verify the ovmf different backed nvram source. Now it only cover the file type.