test/case: minor, cleanup

- Drop redundant comments
 - Drop redundant imports
 - PEP-8 fixes

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-09-01 14:03:51 +02:00
parent 8b39d3fdc7
commit 313554d12e
6 changed files with 8 additions and 31 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ endif::topdoc[]
. Verify new hostname 'h0stn4m3'
. Set hostname to '%h-%m'
. Verify hostname is %h-%m in running configuration
. Verify hostname format in operational, according to format
. Verify hostname format in operational
<<<
+7 -9
View File
@@ -10,8 +10,6 @@ where MAC is the last three bytes of the base MAC address.
e.g. ix-01-01-01.
"""
import random
import string
import re
import infamy
@@ -20,33 +18,33 @@ with infamy.Test() as test:
env = infamy.Env()
target = env.attach("target", "mgmt")
tgtssh = env.attach("target", "mgmt", "ssh")
fmt = "%h-%m"
new="h0stn4m3"
FMT = "%h-%m"
NEW = "h0stn4m3"
with test.step("Set hostname to 'h0stn4m3'"):
target.put_config_dict("ietf-system", {
"system": {
"hostname": new,
"hostname": NEW,
}
})
with test.step("Verify new hostname 'h0stn4m3'"):
running = target.get_config_dict("/ietf-system:system")
assert running["system"]["hostname"] == new
assert running["system"]["hostname"] == NEW
with test.step("Set hostname to '%h-%m'"):
target.put_config_dict("ietf-system", {
"system": {
"hostname": fmt,
"hostname": FMT,
}
})
with test.step("Verify hostname is %h-%m in running configuration"):
running = target.get_config_dict("/ietf-system:system")
if running["system"]["hostname"] != fmt:
if running["system"]["hostname"] != FMT:
test.fail()
with test.step("Verify hostname format in operational, according to format"):
with test.step("Verify hostname format in operational"):
cmd = tgtssh.runsh("sed -n s/^DEFAULT_HOSTNAME=//p /etc/os-release")
default = cmd.stdout.rstrip()
@@ -1,11 +1,4 @@
#!/usr/bin/env python3
#
# Verify that a simple web server container can be configured to run
# with host networking, on port 80. Operation is verified using a
# simple GET request for index.html and checking for a key phrase.
#
# The RPC actions: stop + start, and restart are also verified.
#
"""
Container basic
@@ -1,9 +1,4 @@
#!/usr/bin/env python3
#
# Verify connectivity with a simple web server container from behind a
# docker0 bridge. As an added twist, this test also verifies content
# mounts, i.e., custom index.html from running-config.
#
"""
Container with bridge network
@@ -1,15 +1,10 @@
#!/usr/bin/env python3
#
# Verify connectivity with a simple web server container that's been
# given a physical interface instead of an end of a VETH pair.
#
"""
Container with physical interface
Verify connectivity with a simple web server container that's been
given a physical interface instead of an end of a VETH pair.
"""
import base64
import infamy
from infamy.util import until, to_binary
@@ -1,8 +1,4 @@
#!/usr/bin/env python3
#
# Verify connectivity with a simple web server container from behind a
# regular bridge, a VETH pair connects the container to the bridge.
#
r"""
Container with VETH pair