tests/ignition: update test to current framework

Use `dnsmasq` instead, as rhcos also includes this user.
This commit is contained in:
HuijingHei 2023-10-12 22:00:31 +08:00
parent c20d59f111
commit a474453a98
3 changed files with 12 additions and 15 deletions

View file

@ -1,12 +1,11 @@
---
variant: fcos
version: 1.0.0
version: 1.4.0
storage:
files:
- path: /etc/zincati/config.d/00-dummy-placeholder.toml
- path: /etc/dnsmasq/config.d/00-dummy-placeholder.toml
mode: 0644
user:
name: "zincati"
name: "dnsmasq"
contents:
inline: |
# Dummy placeholder

View file

@ -0,0 +1 @@
../../../data/commonlib.sh

View file

@ -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/dnsmasq/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}" != 'dnsmasq' ; then
fatal "unexpected owner of ${TARGET}: ${OWNER}"
fi
ok "placeholder file correctly owned by zincati user"
ok "placeholder file correctly owned by dnsmasq user"