Skip to content

Commit

Permalink
tests/ignition: update test to current framework
Browse files Browse the repository at this point in the history
  • Loading branch information
HuijingHei committed Oct 17, 2023
1 parent c20d59f commit 3af42d3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tests/kola/ignition/sysusers/data/commonlib.sh
19 changes: 8 additions & 11 deletions tests/kola/ignition/sysusers/test.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 3af42d3

Please sign in to comment.