From 16d58abc9f9ff00293d370ece5002bebb6b43783 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Tue, 29 Nov 2022 14:04:10 +0100 Subject: [PATCH] ign smoke tests Signed-off-by: Antonio Murdaca --- test/cases/ostree-simplified-installer.sh | 73 +++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/test/cases/ostree-simplified-installer.sh b/test/cases/ostree-simplified-installer.sh index fbdd2a62861..0d65f282ff7 100755 --- a/test/cases/ostree-simplified-installer.sh +++ b/test/cases/ostree-simplified-installer.sh @@ -446,6 +446,79 @@ sudo mount -o loop "${ISO_FILENAME}" /mnt/installer sudo cp -R /mnt/installer/* ${HTTPD_PATH}/httpboot/ sudo chmod -R +r ${HTTPD_PATH}/httpboot/* +# TODO(runcom): change this to butane to check that too +# also, write the very same test for ostree-raw-image +IGN_PATH="${HTTPD_PATH}/ignition" +sudo mkdir -p ${IGN_PATH} +IGN_CONFIG_PATH="${IGN_PATH}/config.ign" +tee "$IGN_CONFIG_PATH" > /dev/null << EOF +{ + "ignition": { + "config": { + "merge": [ + { + "source": "http://192.168.100.1/ignition/sample.ign" + } + ] + }, + "timeouts": { + "httpTotal": 30 + }, + "version": "3.3.0" + }, + "passwd": { + "users": [ + { + "groups": [ + "wheel" + ], + "name": "core", + "passwordHash": "\$6\$jfuNnO9t1Bv7N.7k\$HqRxq2bltR3zMyAHjsSzbe7uBHXErO1Yvqpi6ljcI06dQBkfWXXZCuE.mJcklPTwaA9r/xpJiEdWDqtxle7h81" + } + ] + } +} +EOF + +IGN_CONFIG_SAMPLE_PATH="${IGN_PATH}/sample.ign" +tee "$IGN_CONFIG_SAMPLE_PATH" > /dev/null << EOF +{ + "ignition": { + "version": "3.3.0" + }, + "storage": { + "files": [ + { + "path": "/usr/local/bin/startup.sh", + "contents": { + "compression": "", + "source": "data:;base64,IyEvYmluL2Jhc2gKZWNobyAiSGVsbG8sIFdvcmxkISIK" + }, + "mode": 493 + } + ] + }, + "systemd": { + "units": [ + { + "contents": "[Unit]\nDescription=A hello world unit!\n[Service]\nType=oneshot\nRemainAfterExit=yes\nExecStart=/usr/local/bin/startup.sh\n[Install]\nWantedBy=multi-user.target\n", + "enabled": true, + "name": "hello.service" + }, + { + "dropins": [ + { + "contents": "[Service]\nEnvironment=LOG_LEVEL=trace\n", + "name": "log_trace.conf" + } + ], + "name": "fdo-client-linuxapp.service" + } + ] + } +} +EOF + greenprint "📋 Update grub.cfg file for http boot" sudo sed -i 's/timeout=60/timeout=10/' "${GRUB_CFG}" sudo sed -i 's/coreos.inst.install_dev=\/dev\/sda/coreos.inst.install_dev=\/dev\/vda/' "${GRUB_CFG}"