From 746ddbc6e17d9ab8238cc4a8e3a348ccb44878b5 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 8 Sep 2020 12:23:48 +0300 Subject: test: add a subplot to verify the roles work --- roles/unix_users/subplot.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 roles/unix_users/subplot.py (limited to 'roles/unix_users/subplot.py') diff --git a/roles/unix_users/subplot.py b/roles/unix_users/subplot.py new file mode 100644 index 0000000..118d007 --- /dev/null +++ b/roles/unix_users/subplot.py @@ -0,0 +1,7 @@ +def host_has_user(ctx, username=None): + assert_eq = globals()["assert_eq"] + qemu = ctx["qemu"] + output, exit = qemu.ssh(["getent", "passwd", username]) + assert_eq(exit, 0) + output = output.decode("UTF8") + assert f"\n{username}:" in output -- cgit v1.2.1