Skip to content

Commit 140eeac

Browse files
committed
tmt: Add new tmt scripts path to $PATH
Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
1 parent 8eca9ae commit 140eeac

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

hack/provision-derived.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ case "$variant" in
2222
# tmt wants rsync
2323
dnf -y install cloud-init rsync
2424
ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants
25-
# And tmt wants to write to /usr/local/bin
26-
rm /usr/local -rf && ln -sr /var/usrlocal /usr/local && mkdir -p /var/usrlocal/bin
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
2729

2830
# tmt needs a webserver to verify the VM is running
2931
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"

tests/plugins/bootc-install.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ def _build_derived_image(self, base_image: str) -> str:
186186
187187
RUN dnf -y install cloud-init rsync && \
188188
ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants && \
189-
rm /usr/local -rf && ln -sr /var/usrlocal /usr/local && mkdir -p /var/usrlocal/bin && \
189+
touch /etc/environment && \
190+
echo "export PATH=$PATH:/var/lib/tmt/scripts" >> /etc/environment && \
190191
dnf clean all && \
191192
echo "{{ testcloud_guest }}" >> /opt/testcloud-guest.sh && \
192193
chmod +x /opt/testcloud-guest.sh && \

0 commit comments

Comments
 (0)