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

iface_network/dhcp_range: expect second guest not to get IP #6064

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smitterl
Copy link
Contributor

In 1e88841 utils_net.get_guest_ip_addr was replaced by network_base.get_vm_ip. However, the first function returned None when IP wasn't available whereas the second function raises a test error. Update the code to handle the test error in the same way it would have handle a return value None.

In this specific case, when dhcp_range is tested, the range is very small so the second VM is expected not to get an ip.

In 1e88841 `utils_net.get_guest_ip_addr` was replaced by
`network_base.get_vm_ip`. However, the first function returned
`None` when IP wasn't available whereas the second function
raises a test error. Update the code to handle the test error
in the same way it would have handle a return value `None`.

In this specific case, when dhcp_range is tested, the range is
very small so the second VM is expected not to get an ip.

Signed-off-by: Sebastian Mitterle <[email protected]>
@smitterl
Copy link
Contributor Author

test cases with multiple_guests > 0, only these execute the loop over vms_list

JOB ID     : d00742007e146e1105bd47e61ad010baea920716
JOB LOG    : /var/log/avocado/job-results/job-2024-12-12T12.27-d007420/job.log
 (1/1) type_specific.io-github-autotest-libvirt.virtual_network.iface_network.net_macvtap.net_bridge.multi_guests: STARTED
 (1/1) type_specific.io-github-autotest-libvirt.virtual_network.iface_network.net_macvtap.net_bridge.multi_guests: PASS (89.14 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/log/avocado/job-results/job-2024-12-12T12.27-d007420/results.html
JOB TIME   : 90.69 s
JOB ID     : 68bb20618e9a4a7bd7477a62df9694223a26ba4e
JOB LOG    : /var/log/avocado/job-results/job-2024-12-12T12.24-68bb206/job.log
 (1/1) type_specific.io-github-autotest-libvirt.virtual_network.iface_network.dnsmasq_test.net_dhcp_range: STARTED
 (1/1) type_specific.io-github-autotest-libvirt.virtual_network.iface_network.dnsmasq_test.net_dhcp_range: PASS (122.79 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/log/avocado/job-results/job-2024-12-12T12.24-68bb206/results.html
JOB TIME   : 124.55 s

@chloerh
Copy link
Contributor

chloerh commented Dec 13, 2024

@smitterl maybe the function get_vm_ip() could be updated to return None instead of raising error, to avoid different behavior. I think I could just add an arg and make it work. What do you think?

@smitterl
Copy link
Contributor Author

@smitterl maybe the function get_vm_ip() could be updated to return None instead of raising error, to avoid different behavior. I think I could just add an arg and make it work. What do you think?

Do you mean I should add an arg like "raise_on_error" that per default would be True to keep the current behavior but enable behavior of get_guest_ip_addr via raise_on_error=False? I think that would work.

@chloerh
Copy link
Contributor

chloerh commented Dec 16, 2024

@smitterl maybe the function get_vm_ip() could be updated to return None instead of raising error, to avoid different behavior. I think I could just add an arg and make it work. What do you think?

Do you mean I should add an arg like "raise_on_error" that per default would be True to keep the current behavior but enable behavior of get_guest_ip_addr via raise_on_error=False? I think that would work.

Yes. I could update it too. 🤝

@chloerh
Copy link
Contributor

chloerh commented Jan 23, 2025

Updated function get_vm_ip:

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.

2 participants