-
Notifications
You must be signed in to change notification settings - Fork 115
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
Verify a variable created and added to the host #14477
Verify a variable created and added to the host #14477
Conversation
trigger: test-robottelo |
8db1360
to
65d44b5
Compare
trigger: test-robottelo |
PRT Result
|
tests/foreman/ui/test_ansible.py
Outdated
session.ansiblevariables.create_with_overrides( | ||
{ | ||
'key': key, | ||
'ansible_role': SELECTED_ROLE, | ||
'override': 'true', | ||
'parameter_type': 'array', | ||
'default_value': '[\'test\']', | ||
'validator_type': None, | ||
'attribute_order': 'domain \n fqdn \n hostgroup \n os', |
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.
It looks like this test is just extending the existing test_positive_create_variable_with_overrides, so can we combine this two tests by adding a assert for verifying if variable is created or etc?
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.
The existing test is taking integer type and the BZ was specific about array(which will contain string) type.
values = session.host_new.get_details(rhel_contenthost.hostname, 'ansible')['ansible'][ | ||
'variables' | ||
]['table'] |
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.
Can we add a check for verifying the assigned role here first on host then variable?
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.
We already have the test for it test_positive_host_role_information, so if you agree on this we can combine this too and remove the existing test?
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.
It doesn't matter here. But I can surely add 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.
well, you're asserting for var['Ansible role']
currently, but what I meant was that in the Ansible tab, check the roles subtab rather than the variables subtab, for roles assigned as similar to test_positive_host_role_information
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 am verifying the role has been assigned to the variable which is needed for the this test.
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.
its a good thing to check, but its fine, we can skip this check for now
command = target_sat.api.RegistrationCommand( | ||
organization=module_org, | ||
location=module_location, | ||
activation_keys=[module_activation_key.name], | ||
).create() | ||
result = rhel_contenthost.execute(command) |
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.
As you're not using the host here, so you could skip the rhel_contenthost and its registration, instead create a fake host without registration and assign the role directly
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.
Good to use the actual host here.
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.
Either way, this should be setup.
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, it is part of setup, but we're using fake hosts everywhere for such tests for Ansible component, also this will make the execution faster and will save time for unnecessary checkout of actual host
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.
It is using container so it doesn't take much time.
65d44b5
to
597cedd
Compare
trigger: test-robottelo |
PRT Result
|
597cedd
to
72bbe92
Compare
PRT 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.
ACK pending comments
cd8ff11
to
b67774c
Compare
trigger: test-robottelo |
trigger: test-robottelo |
PRT Result
|
b67774c
to
a787d66
Compare
trigger: test-robottelo |
PRT Result
|
(cherry picked from commit fc64c78)
(cherry picked from commit fc64c78)
(cherry picked from commit fc64c78)
(cherry picked from commit fc64c78)
(cherry picked from commit fc64c78)
(cherry picked from commit fc64c78)
(cherry picked from commit fc64c78)
(cherry picked from commit fc64c78)
Problem Statement
We are missing scenario for creating and adding variable to the host.
Automated BZ: 2170727
Solution
Added the scenario
Related Issues