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 function to check host network connectivity #55

Merged

Conversation

cynepco3hahue
Copy link
Collaborator

@cynepco3hahue cynepco3hahue commented Apr 27, 2016

covers #29

@lukas-bednar
Copy link
Member

@cynepco3hahue It is great, just please add dummy test which pings 127.0.0.1.

regarding to ping6, I am not sure whether it will work, because in Host.init there is ipv4 validation for Host.ip, so it basically impossible to create instance of ipv6 Host. Also I can find that function on other places ...

rrmngmnt/host.py:62:        if not netaddr.valid_ipv4(ip):
rrmngmnt/network.py:201:                if netaddr.valid_ipv4(default_gw[0]):
rrmngmnt/network.py:221:                if netaddr.valid_ipv4(ip[0]):
rrmngmnt/network.py:272:            if netaddr.valid_ipv4(interface_ip):
tests/test_common.py:9:    assert netaddr.valid_ipv4(ip)

Please open issue to support ipv6 hosts.


:param ping_timeout: time to wait for response
:type ping_timeout: float
:param ipv6: if address IPV6
Copy link
Member

Choose a reason for hiding this comment

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

I think this param is not necessary, you can use netaddr.valid_ipv6(self.host.ip) function to decide what command to use. like:

ping_cmd = "ping6" if netaddr.valid_ipv6(self.host.ip) else "ping"

@@ -3,6 +3,8 @@ python:
- "2.6"
- "2.7"
- "3.4"
before_install:
- sudo apt-get install inetutils-ping
Copy link
Member

Choose a reason for hiding this comment

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

not all instances supports sudo ... use apt addon instead ...

addons:
  apt:
    packages:
    - iputils-ping

@lukas-bednar lukas-bednar merged commit a9f8c1f into rhevm-qe-automation:master May 4, 2016
@cynepco3hahue cynepco3hahue deleted the network_connectivity branch February 13, 2017 13:45
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