Skip to content
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
4 changes: 1 addition & 3 deletions test/case/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
- settings:
test-spec: Readme.adoc

- case: meta/wait.py
infamy:
specification: False
- case: meta/reproducible.py
infamy:
specification: False

- name: Misc tests
suite: misc/misc.yaml

Expand Down
8 changes: 1 addition & 7 deletions test/case/infix_containers/container_host_commands/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,5 @@
until(lambda: c.running(cont_name), attempts=10)

with test.step("Verify the new hostname set by the container"):
oper = target.get_data("/ietf-system:system")
name = oper["system"]["hostname"]

if name != hostname_new:
print(f"Expected hostname: {hostname_new}, actual hostname: {name}")
test.fail()

until(lambda: c.running(cont_name) != target.get_data("/ietf-system:system")["system"]["hostname"], attempts=10)
test.succeed()
49 changes: 0 additions & 49 deletions test/case/meta/wait.py

This file was deleted.

13 changes: 12 additions & 1 deletion test/infamy/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import random
import inspect

from . import neigh, netconf, restconf, ssh, tap, topology
from . import neigh, netconf, restconf, ssh, tap, topology, util


class NullEnv:
Expand Down Expand Up @@ -116,6 +116,13 @@ def attr(self, name, default=None):
def get_password(self, node):
return self.ptop.get_password(node)

def is_reachable(self, node, port):
ip = neigh.ll6ping(port)
if not ip:
return False

return util.is_reachable(ip, self, self.get_password(node))

def attach(self, node, port="mgmt", protocol=None, test_reset=True, username = None, password = None):
"""Attach to node on port using protocol."""

Expand All @@ -126,6 +133,7 @@ def attach(self, node, port="mgmt", protocol=None, test_reset=True, username = N
else:
mapping = None


# Precedence:
# 1. Caller specifies `protocol`
# 2. User specifies `-t` when executing test
Expand All @@ -141,6 +149,9 @@ def attach(self, node, port="mgmt", protocol=None, test_reset=True, username = N
ctrl = self.ptop.get_ctrl()
cport, _ = self.ptop.get_mgmt_link(ctrl, node)

print("Waiting for DUTs to become reachable...")
util.parallel(util.until(lambda: self.is_reachable(node, cport), 300))

print(f"Probing {node} on port {cport} for IPv6LL mgmt address ...")
mgmtip = neigh.ll6ping(cport)
if not mgmtip:
Expand Down
1 change: 0 additions & 1 deletion test/infamy/netconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

def netconf_syn(addr):
if netutil.tcp_port_is_open(addr, 830):
print(f"{addr} answers to TCP connections on port 830 (NETCONF)")
return True
else:
return False
Expand Down
1 change: 0 additions & 1 deletion test/infamy/restconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def restconf_reachable(neigh, password):
response = requests_workaround_get(url, headers=headers, auth=auth,
verify=False)
if response.status_code == 200:
print(f"{neigh} answers to TCP connections on port 443 (RESTCONF)")
return True
except:
return False
Expand Down