diff --git a/tests/kola/ignition/sysusers/config.bu b/tests/kola/ignition/sysusers/config.bu new file mode 100644 index 0000000000..983be483e1 --- /dev/null +++ b/tests/kola/ignition/sysusers/config.bu @@ -0,0 +1,17 @@ +variant: fcos +version: 1.0.0 +passwd: + users: + - name: usertest + shell: "/usr/sbin/nologin" + gecos: "user test" + system: true +storage: + files: + - path: /etc/usertest/config.d/00-dummy-placeholder.toml + mode: 0644 + user: + name: "usertest" + contents: + inline: | + # Dummy placeholder diff --git a/tests/kola/ignition/sysusers/config.fcc b/tests/kola/ignition/sysusers/config.fcc deleted file mode 100644 index d42a6d19c4..0000000000 --- a/tests/kola/ignition/sysusers/config.fcc +++ /dev/null @@ -1,12 +0,0 @@ ---- -variant: fcos -version: 1.0.0 -storage: - files: - - path: /etc/zincati/config.d/00-dummy-placeholder.toml - mode: 0644 - user: - name: "zincati" - 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"