File tree Expand file tree Collapse file tree 3 files changed +82
-0
lines changed Expand file tree Collapse file tree 3 files changed +82
-0
lines changed Original file line number Diff line number Diff line change
1
+ summary: run bootc switch test on tmt image mode vm
2
+ provision:
3
+ how: virtual
4
+ image: http://images.osci.redhat.com/RHEL-9.6.0-image-mode-x86_64.qcow2
5
+ execute:
6
+ how: tmt
7
+ discover:
8
+ how: fmf
9
+ test:
10
+ - /bootc-switch
Original file line number Diff line number Diff line change
1
+ summary: Run bootc-switch test
2
+ test: ./bootc-switch.sh
3
+ duration: 1h
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -exuo pipefail
3
+
4
+ if [ " $TMT_REBOOT_COUNT " -eq 0 ]; then
5
+ ARCH=$( uname -m)
6
+ TEMPDIR=$( mktemp -d)
7
+ trap ' rm -rf -- "$TEMPDIR"' EXIT
8
+
9
+ # Get OS data.
10
+ # source /etc/os-release
11
+ ID=fedora
12
+ VERSION_ID=42
13
+ case " " ${ID} -${VERSION_ID} " " in
14
+ " centos-9" )
15
+ TIER1_IMAGE_URL=" quay.io/centos-bootc/centos-bootc:stream9"
16
+ BOOTC_COPR_REPO_DISTRO=" centos-stream-9-${ARCH} "
17
+ ;;
18
+ " centos-10" )
19
+ TIER1_IMAGE_URL=" quay.io/centos-bootc/centos-bootc:stream10"
20
+ BOOTC_COPR_REPO_DISTRO=" centos-stream-10-${ARCH} "
21
+ ;;
22
+ " fedora-" * )
23
+ TIER1_IMAGE_URL=" quay.io/fedora/fedora-bootc:${VERSION_ID} "
24
+ BOOTC_COPR_REPO_DISTRO=" fedora-${VERSION_ID} -${ARCH} "
25
+ ;;
26
+ * )
27
+ echo " Don't work with this distro"
28
+ exit 1
29
+ ;;
30
+ esac
31
+
32
+ if [[ " $VERSION_ID " == " 43" ]]; then
33
+ BOOTC_COPR_REPO_DISTRO=" fedora-rawhide-${ARCH} "
34
+ fi
35
+
36
+ CONTAINERFILE=${TEMPDIR} /Containerfile
37
+ tee " $CONTAINERFILE " > /dev/null << REALEOF
38
+ FROM $TIER1_IMAGE_URL
39
+
40
+ RUN <<EORUN
41
+ set -xeuo pipefail
42
+
43
+ cat <<EOF >> /etc/yum.repos.d/bootc.repo
44
+ [bootc]
45
+ name=bootc
46
+ baseurl=https://download.copr.fedorainfracloud.org/results/rhcontainerbot/bootc/${BOOTC_COPR_REPO_DISTRO} /
47
+ enabled=1
48
+ gpgcheck=0
49
+ repo_gpgcheck=0
50
+ EOF
51
+
52
+ dnf -y update bootc
53
+ dnf -y install rsync
54
+ dnf -y clean all
55
+ rm -rf /var/cache /var/lib/dnf
56
+ EORUN
57
+ REALEOF
58
+
59
+ cat " $CONTAINERFILE "
60
+ sudo podman build --tls-verify=false -t localhost/bootc:tmt -f " $CONTAINERFILE " " $TEMPDIR "
61
+ sudo podman images
62
+ sudo bootc switch --transport containers-storage localhost/bootc:tmt
63
+
64
+ tmt-reboot
65
+ elif [ " $TMT_REBOOT_COUNT " -eq 1 ]; then
66
+ bootc status
67
+ echo " bootc switch succeed"
68
+ exit 0
69
+ fi
You can’t perform that action at this time.
0 commit comments