Skip to content

Commit

Permalink
tests: ensure that Ignition warnings are displayed on the console
Browse files Browse the repository at this point in the history
Follow up to coreos#1621 (review)
This adds kola test coverage for displaying Ignition warnings
on the console.
  • Loading branch information
sohankunkerkar committed Apr 13, 2022
1 parent 6dc91d2 commit 231df44
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/kola/ignition/warnings/config.ign
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ignition": {
"version": "3.3.0"
},
"systemd": {
"units": [
{
"contents": "[Unit]\nDescription=echo service template\n[Service]\nType=oneshot\nExecStart=/bin/echo %i\n",
"enabled": true,
"name": "echo.service"
}
]
}
}
1 change: 1 addition & 0 deletions tests/kola/ignition/warnings/data/commonlib.sh
20 changes: 20 additions & 0 deletions tests/kola/ignition/warnings/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# kola: { "platforms": "qemu-unpriv" }
# This test ensures that Ignition warnings
# are displayed on the console.

set -xeuo pipefail

. $KOLA_EXT_DATA/commonlib.sh

warningsfile="/etc/issue.d/30_coreos_ignition_warnings.issue"

# Make sure the motd file gets created
if ! test -f ${warningsfile}; then
fatal "not found ignition warnings issue file"
fi
# Checking for the warning
if ! grep -e 'unit "echo.service" is enabled' ${warningsfile} ; then
fatal "failed to display Ignition warning on the console"
fi
ok "Successfully displayed Ignition warning on the console"

0 comments on commit 231df44

Please sign in to comment.