Skip to content

Commit 6717bbb

Browse files
authored
Merge pull request #1117 from kernelkit/test-stability
Test stability
2 parents a60968b + 7683466 commit 6717bbb

File tree

6 files changed

+14
-62
lines changed

6 files changed

+14
-62
lines changed

test/case/all.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
- settings:
33
test-spec: Readme.adoc
44

5-
- case: meta/wait.py
6-
infamy:
7-
specification: False
85
- case: meta/reproducible.py
96
infamy:
107
specification: False
8+
119
- name: Misc tests
1210
suite: misc/misc.yaml
1311

test/case/infix_containers/container_host_commands/test.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,5 @@
7575
until(lambda: c.running(cont_name), attempts=10)
7676

7777
with test.step("Verify the new hostname set by the container"):
78-
oper = target.get_data("/ietf-system:system")
79-
name = oper["system"]["hostname"]
80-
81-
if name != hostname_new:
82-
print(f"Expected hostname: {hostname_new}, actual hostname: {name}")
83-
test.fail()
84-
78+
until(lambda: c.running(cont_name) != target.get_data("/ietf-system:system")["system"]["hostname"], attempts=10)
8579
test.succeed()

test/case/meta/wait.py

Lines changed: 0 additions & 49 deletions
This file was deleted.

test/infamy/env.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import random
77
import inspect
88

9-
from . import neigh, netconf, restconf, ssh, tap, topology
9+
from . import neigh, netconf, restconf, ssh, tap, topology, util
1010

1111

1212
class NullEnv:
@@ -116,6 +116,13 @@ def attr(self, name, default=None):
116116
def get_password(self, node):
117117
return self.ptop.get_password(node)
118118

119+
def is_reachable(self, node, port):
120+
ip = neigh.ll6ping(port)
121+
if not ip:
122+
return False
123+
124+
return util.is_reachable(ip, self, self.get_password(node))
125+
119126
def attach(self, node, port="mgmt", protocol=None, test_reset=True, username = None, password = None):
120127
"""Attach to node on port using protocol."""
121128

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

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

152+
print("Waiting for DUTs to become reachable...")
153+
util.parallel(util.until(lambda: self.is_reachable(node, cport), 300))
154+
144155
print(f"Probing {node} on port {cport} for IPv6LL mgmt address ...")
145156
mgmtip = neigh.ll6ping(cport)
146157
if not mgmtip:

test/infamy/netconf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
def netconf_syn(addr):
2424
if netutil.tcp_port_is_open(addr, 830):
25-
print(f"{addr} answers to TCP connections on port 830 (NETCONF)")
2625
return True
2726
else:
2827
return False

test/infamy/restconf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def restconf_reachable(neigh, password):
101101
response = requests_workaround_get(url, headers=headers, auth=auth,
102102
verify=False)
103103
if response.status_code == 200:
104-
print(f"{neigh} answers to TCP connections on port 443 (RESTCONF)")
105104
return True
106105
except:
107106
return False

0 commit comments

Comments
 (0)