From 3af42d35e33b3ba64a57d3790012815e5aa3993e Mon Sep 17 00:00:00 2001 From: HuijingHei Date: Thu, 12 Oct 2023 22:00:31 +0800 Subject: [PATCH] tests/ignition: update test to current framework --- .../sysusers/{config.fcc => config.bu} | 8 +++++--- .../kola/ignition/sysusers/data/commonlib.sh | 1 + tests/kola/ignition/sysusers/test.sh | 19 ++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) rename tests/kola/ignition/sysusers/{config.fcc => config.bu} (53%) create mode 120000 tests/kola/ignition/sysusers/data/commonlib.sh diff --git a/tests/kola/ignition/sysusers/config.fcc b/tests/kola/ignition/sysusers/config.bu similarity index 53% rename from tests/kola/ignition/sysusers/config.fcc rename to tests/kola/ignition/sysusers/config.bu index d42a6d19c4..eb478dede1 100644 --- a/tests/kola/ignition/sysusers/config.fcc +++ b/tests/kola/ignition/sysusers/config.bu @@ -1,12 +1,14 @@ ---- variant: fcos version: 1.0.0 +passwd: + users: + - name: usertest storage: files: - - path: /etc/zincati/config.d/00-dummy-placeholder.toml + - path: /etc/usertest/config.d/00-dummy-placeholder.toml mode: 0644 user: - name: "zincati" + name: "usertest" contents: inline: | # Dummy placeholder diff --git a/tests/kola/ignition/sysusers/data/commonlib.sh b/tests/kola/ignition/sysusers/data/commonlib.sh new file mode 120000 index 0000000000..b8dcbdca1a --- /dev/null +++ b/tests/kola/ignition/sysusers/data/commonlib.sh @@ -0,0 +1 @@ +../../../data/commonlib.sh \ No newline at end of file diff --git a/tests/kola/ignition/sysusers/test.sh b/tests/kola/ignition/sysusers/test.sh index 049b0825fe..907db7f17a 100755 --- a/tests/kola/ignition/sysusers/test.sh +++ b/tests/kola/ignition/sysusers/test.sh @@ -1,20 +1,17 @@ #!/usr/bin/env bash -set -euo pipefail +## kola: +## platforms: qemu +## description: Verify file ownership can reference system users. -ok() { - echo "ok" "$@" -} +set -xeuo pipefail -fatal() { - echo "$@" >&2 - exit 1 -} +. "$KOLA_EXT_DATA/commonlib.sh" -TARGET="/etc/zincati/config.d/00-dummy-placeholder.toml" +TARGET="/etc/usertest/config.d/00-dummy-placeholder.toml" OWNER=$(stat -c '%U' "${TARGET}") # make sure the placeholder file is owned by the proper system user. -if test "${OWNER}" != 'zincati' ; then +if test "${OWNER}" != 'usertest' ; then fatal "unexpected owner of ${TARGET}: ${OWNER}" fi -ok "placeholder file correctly owned by zincati user" +ok "placeholder file correctly owned by usertest user"