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

Remove the external ping test #293

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions tests/inventory_data/external_hosts.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions tests/plugins/tasks/networking/test_tcp_ping.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import os


from nornir import InitNornir
from nornir.plugins.tasks import networking


cur_dir = os.path.dirname(os.path.realpath(__file__))
ext_inv_file = "{}/../../../inventory_data/external_hosts.yaml".format(cur_dir)


class Test(object):
def test_tcp_ping_port(self, nornir):
filter = nornir.filter(name="dev4.group_2")
Expand Down Expand Up @@ -42,18 +36,3 @@ def test_tcp_ping_invalid_ports(self, nornir):
processed = True
assert isinstance(result.exception, ValueError)
assert processed

def test_tcp_ping_external_hosts(self):
external = InitNornir(
inventory={"options": {"host_file": ext_inv_file}}, dry_run=True
Copy link
Contributor

@dbarrosop dbarrosop Dec 28, 2018

Choose a reason for hiding this comment

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

Is the file needed at all? We can probably remove the resources that were used by this test.

)
result = external.run(networking.tcp_ping, ports=[23, 443])

assert result
for h, r in result.items():
if h == "www.github.com":
assert r.result[23] is False
assert r.result[443]
else:
assert r.result[23] is False
assert r.result[443]