-
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
update assertion for discovery plugin test as per IPv4/Ipv6 ip address #17633
base: master
Are you sure you want to change the base?
update assertion for discovery plugin test as per IPv4/Ipv6 ip address #17633
Conversation
06ed385
to
2020174
Compare
@@ -236,7 +236,10 @@ def _finalize(): | |||
values = session.discoveryrule.read_discovered_hosts(discovery_rule.name) | |||
assert values['searchbox'] == rule_search | |||
assert len(values['table']) == 1 | |||
assert values['table'][0]['IP Address'] == ip_address | |||
if values['table'][0]['IPv4'] != '': |
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 can assert the values based on server.is_ipv6
but this won't work when we will have dual stack network so I would suggest to assert both without if else.
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.
When a dual-stack network is available, we can take the appropriate action accordingly.
When creating a discovery host, there are two columns for IPv4 and IPv6. The values are fetched from these columns and matched with ip_address = gen_ipaddr()
. I believe we need to update this section ip_address = gen_ipaddr()
to ensure the assertion works with dual-stack later.
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 understand that but you would still need to check which address to read (ipv4 or ipv6) from UI instead of values['table'][0]['IP Address']
.
gen_ipaddr() already takes care of which ip address to pick.
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.
Do you have an example for reference?
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.
Did you try assert values['table'][0]['IPv6' if settings.server.is_ipv6 else 'IPv4'] == ip_address
?
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.
@amolpati30 I don't think there is any reference in robottelo currently but you can check based on is_ipv6.
7de2b5a
to
8ae932a
Compare
5917a4b
to
cff307e
Compare
cff307e
to
8dc923c
Compare
trigger: test-robottelo |
PRT Result
|
trigger: test-robottelo |
PRT Result
|
Previously, there was only one column for
IP Address
. However, starting fromversion 6.17
, bothIPv4
andIPv6
networks are used. When a discovery host is created, two separate columns are displayed forIPv4
andIPv6
. To prevent assertion failures, the IP address will be fetched based on the respective network.Prior -
Latest -