11#! /bin/bash
22set -xeu
3- variant=$1
43# I'm a big fan of nushell for interactive use, and I want to support
54# using it in our test suite because it's better than bash. First,
65# enable EPEL to get it.
@@ -15,35 +14,4 @@ mkdir -p ~/.config/nushell
1514echo ' $env.config = { show_banner: false, }' > ~ /.config/nushell/config.nu
1615touch ~ /.config/nushell/env.nu
1716dnf -y install nu
18- # And we also add pytest, to support running tests written in Python
19- dnf -y install python3-pytest
20- case " $variant " in
21- tmt)
22- # tmt wants rsync
23- dnf -y install cloud-init rsync
24- ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants
25-
26- # tmt puts scrips in /var/lib/tmt/scripts, add them to $PATH
27- touch /etc/environment
28- echo " export PATH=$PATH :/var/lib/tmt/scripts" >> /etc/environment
29-
30- # tmt needs a webserver to verify the VM is running
31- 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"
32- echo " $TESTCLOUD_GUEST " >> /opt/testcloud-guest.sh
33- chmod +x /opt/testcloud-guest.sh
34- echo " [Unit]" >> /etc/systemd/system/testcloud.service
35- echo " Description=Testcloud guest integration" >> /etc/systemd/system/testcloud.service
36- echo " After=cloud-init.service" >> /etc/systemd/system/testcloud.service
37- echo " [Service]" >> /etc/systemd/system/testcloud.service
38- echo " ExecStart=/bin/bash /opt/testcloud-guest.sh" >> /etc/systemd/system/testcloud.service
39- echo " [Install]" >> /etc/systemd/system/testcloud.service
40- echo " WantedBy=multi-user.target" >> /etc/systemd/system/testcloud.service
41- systemctl enable testcloud.service
42- ;;
43- " " ) echo " No variant"
44- ;;
45- * )
46- echo " Unknown variant: $1 " exit 1
47- ;;
48- esac
4917dnf clean all && rm /var/log/* -rf
0 commit comments