mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 07:33:01 +02:00
test: Add ietf_system/hostname
This commit is contained in:
committed by
Joachim Wiberg
parent
0fc720d48a
commit
d82da157b6
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import random, string
|
||||
|
||||
import infamy
|
||||
|
||||
with infamy.Test() as test:
|
||||
with test.step("Initialize"):
|
||||
env = infamy.Env(infamy.std_topology("1x1"))
|
||||
target = env.attach("target", "mgmt")
|
||||
|
||||
with test.step("Set new hostname"):
|
||||
new = "".join((random.choices(string.ascii_lowercase, k=16)))
|
||||
|
||||
target.put_config_dict("ietf-system", {
|
||||
"system": {
|
||||
"hostname": new,
|
||||
}
|
||||
})
|
||||
|
||||
with test.step(f"Verify new hostname ({new})"):
|
||||
running = target.get_config_dict("/ietf-system:system")
|
||||
assert(running["system"]["hostname"] == new)
|
||||
|
||||
test.succeed()
|
||||
Reference in New Issue
Block a user