Skip to content

Commit c20d59f

Browse files
lucabHuijingHei
authored andcommitted
tests/ignition: check file ownership for system users
This ensure that entries in Ignition configuration can reference system users even if not present in ostree commit (e.g. `zincati). (cherry picked from commit dd25144)
1 parent 42db380 commit c20d59f

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
variant: fcos
3+
version: 1.0.0
4+
storage:
5+
files:
6+
- path: /etc/zincati/config.d/00-dummy-placeholder.toml
7+
mode: 0644
8+
user:
9+
name: "zincati"
10+
contents:
11+
inline: |
12+
# Dummy placeholder

tests/kola/ignition/sysusers/test.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ok() {
5+
echo "ok" "$@"
6+
}
7+
8+
fatal() {
9+
echo "$@" >&2
10+
exit 1
11+
}
12+
13+
TARGET="/etc/zincati/config.d/00-dummy-placeholder.toml"
14+
OWNER=$(stat -c '%U' "${TARGET}")
15+
16+
# make sure the placeholder file is owned by the proper system user.
17+
if test "${OWNER}" != 'zincati' ; then
18+
fatal "unexpected owner of ${TARGET}: ${OWNER}"
19+
fi
20+
ok "placeholder file correctly owned by zincati user"

0 commit comments

Comments
 (0)