Skip to content

Commit d350b3e

Browse files
committed
handle ISO url directly and do downloading as part of TMT preparation
1 parent 271f375 commit d350b3e

3 files changed

Lines changed: 35 additions & 7 deletions

File tree

containers/runner/launch

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,10 @@ $CRUN run -it --rm --device=/dev/kvm --publish 127.0.0.1::16509 $PODMAN_SELINUX_
199199
-v "$DATA_DIR:/opt/kstest/data:z" \
200200
-v "$BASEDIR:/kickstart-tests:ro,z" \
201201
$CONTAINER $RUN_COMMAND
202-
set +x
203-
# Store the exit status of the CRUN command
204202
CRUN_EXIT_STATUS=$?
203+
# Store the exit status of the CRUN command
204+
set +x
205+
205206
206207
# If executed via TMT, store results and logs to proper TMT dir
207208
# Store logs to TMT_TEST_DATA directory if set

plans/granular.fmf

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
summary: Run anaconda tests granurally on CentOS stream images
2+
description: |
3+
Execute TMT test each test alone, without running whole testsuire.
4+
example how to run it:
5+
tmt -vv run \
6+
-e ISO_URL=https://composes.stream.centos.org/stream-10/production/latest-CentOS-Stream/compose/BaseOS/x86_64/iso/CentOS-Stream-10-20251003.0-x86_64-boot.iso \
7+
-e PLATFORM_PARAM="--platform rhel10"
8+
plan --name granular test --name keyboard
9+
possible to pass
10+
211
provision:
312
hardware:
413
virtualization:
514
is-supported: true
615
memory: '>= 8 GB'
716

17+
environment:
18+
DATA_DIR: /opt/anaconda_data_dir
19+
ISO_URL: https://composes.stream.centos.org/stream-10/production/latest-CentOS-Stream/compose/BaseOS/x86_64/iso/CentOS-Stream-10-20251003.0-x86_64-boot.iso
20+
# PLATFORM_PARAM is passed to TMT tests for launch script. It could be empty in case of fedora.
21+
PLATFORM_PARAM: "--platform rhel10"
22+
823
discover:
924
- how: fmf
1025
filter: "tag: -knownfailure & tag: -manual & tag:-skip-on-rhel"
@@ -20,9 +35,22 @@ prepare:
2035
- qemu-kvm
2136
- libvirt
2237
- git
23-
# - how: shell
24-
# script:
25-
# - curl --insecure -o ./data/images/boot-rhel10.iso http://ftp.sh.cvut.cz/centos-stream/10-stream/BaseOS/x86_64/iso/CentOS-Stream-10-20250707.0-x86_64-boot.iso
38+
- how: shell
39+
name: prepare directory structure
40+
script:
41+
- mkdir -p $DATA_DIR/{logs,images}
42+
- chmod a+rwx $DATA_DIR
43+
- how: shell
44+
name: download image to proper location
45+
script: |
46+
FILE_NAME=$(basename $ISO_URL)
47+
IMAGE_DEST="$DATA_DIR/images/$FILE_NAME"
48+
TARGET_FILE="boot-${PLATFORM_PARAM##* }.iso"
49+
if [ ! -e $IMAGE_DEST ]; then
50+
curl --insecure -o "$IMAGE_DEST" "$ISO_URL"
51+
fi
52+
# file has to be hardlink or direct file, symlink does not work well here.
53+
ln -f "$IMAGE_DEST" "$(dirname $IMAGE_DEST)/$TARGET_FILE"
2654

2755
report:
2856
how: html

tests.fmf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,5 +1940,4 @@
19401940
- network
19411941
test+: vlan-pre.sh
19421942
duration: 50m
1943-
test: './containers/runner/launch '
1944-
# test: './containers/runner/launch --data /var/tmp/ks_data --platform rhel10 '
1943+
test: './containers/runner/launch --data "$DATA_DIR" $PLATFORM_PARAM '

0 commit comments

Comments
 (0)