Skip to content

Commit e1ea6f1

Browse files
committed
tmt: Add webserver to provision-derived
Our custom tmt image needs to start the web server on port 10022 that tmt expects. Signed-off-by: Chris Kyrouac <[email protected]>
1 parent 33bd0cc commit e1ea6f1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

hack/provision-derived.sh

+13
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ case "$variant" in
2424
ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants
2525
# And tmt wants to write to /usr/local/bin
2626
rm /usr/local -rf && ln -sr /var/usrlocal /usr/local && mkdir -p /var/usrlocal/bin
27+
28+
# tmt needs a webserver to verify the VM is running
29+
TESTCLOUD_GUEST="python3 -m http.server 10022 || python -m http.server 10022 || /usr/libexec/platform-python -m http.server 10022 || python2 -m SimpleHTTPServer 10022 || python -m SimpleHTTPServer 10022"
30+
echo "$TESTCLOUD_GUEST" >> /opt/testcloud-guest.sh
31+
chmod +x /opt/testcloud-guest.sh
32+
echo "[Unit]" >> /etc/systemd/system/testcloud.service
33+
echo "Description=Testcloud guest integration" >> /etc/systemd/system/testcloud.service
34+
echo "After=cloud-init.service" >> /etc/systemd/system/testcloud.service
35+
echo "[Service]" >> /etc/systemd/system/testcloud.service
36+
echo "ExecStart=/bin/bash /opt/testcloud-guest.sh" >> /etc/systemd/system/testcloud.service
37+
echo "[Install]" >> /etc/systemd/system/testcloud.service
38+
echo "WantedBy=multi-user.target" >> /etc/systemd/system/testcloud.service
39+
systemctl enable testcloud.service
2740
;;
2841
"") echo "No variant"
2942
;;

0 commit comments

Comments
 (0)