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 4ebeb00
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
17 changes: 17 additions & 0 deletions tests/kola/ignition/sysusers/config.bu
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions tests/kola/ignition/sysusers/config.fcc

This file was deleted.

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 4ebeb00

Please sign in to comment.