From d82da157b673a817aee7af41a63c1e2719a21e42 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Wed, 24 May 2023 00:24:06 +0200 Subject: [PATCH] test: Add ietf_system/hostname --- test/case/ietf_system/hostname.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 test/case/ietf_system/hostname.py diff --git a/test/case/ietf_system/hostname.py b/test/case/ietf_system/hostname.py new file mode 100755 index 00000000..88182663 --- /dev/null +++ b/test/case/ietf_system/hostname.py @@ -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()