Skip to content

Commit

Permalink
tmt: Add new tmt scripts path to $PATH
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Kyrouac <[email protected]>
  • Loading branch information
ckyrouac committed Oct 31, 2024
1 parent 8eca9ae commit 140eeac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions hack/provision-derived.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ case "$variant" in
# tmt wants rsync
dnf -y install cloud-init rsync
ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants
# And tmt wants to write to /usr/local/bin
rm /usr/local -rf && ln -sr /var/usrlocal /usr/local && mkdir -p /var/usrlocal/bin

# tmt puts scrips in /var/lib/tmt/scripts, add them to $PATH
touch /etc/environment
echo "export PATH=$PATH:/var/lib/tmt/scripts" >> /etc/environment

# tmt needs a webserver to verify the VM is running
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"
Expand Down
3 changes: 2 additions & 1 deletion tests/plugins/bootc-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ def _build_derived_image(self, base_image: str) -> str:
RUN dnf -y install cloud-init rsync && \
ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants && \
rm /usr/local -rf && ln -sr /var/usrlocal /usr/local && mkdir -p /var/usrlocal/bin && \
touch /etc/environment && \
echo "export PATH=$PATH:/var/lib/tmt/scripts" >> /etc/environment && \
dnf clean all && \
echo "{{ testcloud_guest }}" >> /opt/testcloud-guest.sh && \
chmod +x /opt/testcloud-guest.sh && \
Expand Down

0 comments on commit 140eeac

Please sign in to comment.