Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/ignition: check file ownership for system users #2670

Open
wants to merge 2 commits into
base: testing-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/kola/ignition/sysusers/config.bu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variant: fcos
version: 1.4.0
storage:
files:
- path: /etc/dnsmasq/config.d/00-dummy-placeholder.toml
mode: 0644
user:
name: "dnsmasq"
contents:
inline: |
# Dummy placeholder
1 change: 1 addition & 0 deletions tests/kola/ignition/sysusers/data/commonlib.sh
17 changes: 17 additions & 0 deletions tests/kola/ignition/sysusers/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
## kola:
## platforms: qemu
## description: Verify file ownership can reference system users.

set -xeuo pipefail

. "$KOLA_EXT_DATA/commonlib.sh"

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