Add test for passing custom option on kernel command line

This commit is contained in:
Jiri Kortus 2019-04-08 11:00:41 +02:00 committed by Alexander Todorov
parent 596cba2255
commit 123b5c269d
5 changed files with 24 additions and 0 deletions

View File

@ -8,6 +8,7 @@ verify_image() {
SSH_OPTS="-o StrictHostKeyChecking=no $3"
rlLogInfo "verify_image: SSH_OPTS:'$SSH_OPTS' SSH_USER:'$SSH_USER' SSH_MACHINE: '$SSH_MACHINE'"
check_root_account "$@"
check_kernel_cmdline "$@"
}
check_root_account() {
@ -42,3 +43,8 @@ check_root_account() {
rlRun -t -c "ssh $SSH_OPTS ${SSH_USER}@${SSH_MACHINE} 'cat /etc/redhat-release'"
}
# verify that a kernel command line argument was passed from the blueprint (this is added to the blueprint in ../test_cli.sh)
check_kernel_cmdline() {
rlRun -t -c "ssh $SSH_OPTS ${SSH_USER}@${SSH_MACHINE} 'grep custom_cmdline_arg /proc/cmdline'" 0 \
"System booted from the image contains specified parameter on kernel command line"
}

View File

@ -60,6 +60,10 @@ version = "*"
[[packages]]
name = "rng-tools"
version = "*"
[customizations.kernel]
append = "custom_cmdline_arg"
__EOF__
rlRun -t -c "$CLI blueprints push $TMP_DIR/http-with-rng.toml"

View File

@ -82,6 +82,9 @@ version = "*"
[[customizations.user]]
name = "root"
key = "$PUB_KEY"
[customizations.kernel]
append = "custom_cmdline_arg"
__EOF__
rlRun -t -c "$CLI blueprints push $TMP_DIR/vmware.toml"

View File

@ -43,6 +43,9 @@ version = "*"
[[customizations.user]]
name = "root"
key = "$PUB_KEY"
[customizations.kernel]
append = "custom_cmdline_arg"
__EOF__
rlRun -t -c "$CLI blueprints push $TMP_DIR/with-ssh.toml"

View File

@ -15,6 +15,14 @@ function setup_tests {
/%end/ && FLAG == 1 {print \"sed -i 's/.*PermitEmptyPasswords.*/PermitEmptyPasswords yes/' /etc/ssh/sshd_config\"; FLAG=2}
{print}" \
$1/composer/live-iso.ks
# append a section with additional option on kernel command line to example-http-server blueprint
# which is used for building of most of the images
cat >> $BLUEPRINTS_DIR/example-http-server.toml << __EOF__
[customizations.kernel]
append = "custom_cmdline_arg"
__EOF__
}
function teardown_tests {