Skip to content

Commit f28b314

Browse files
committed
test: Fix test failure
1. Fix variable issue in test-bound-storage 2. Fix permission issue in logically-bound-switch, image-pushpull-upgrade, soft-reboot and custom-selinux-policy Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
1 parent ec438ac commit f28b314

File tree

7 files changed

+12
-11
lines changed

7 files changed

+12
-11
lines changed

tmt/tests/booted/readonly/017-test-bound-storage.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if not (bootc_testlib have_hostexports) {
1111
bootc status
1212
let st = bootc status --json | from json
1313
let is_composefs = ($st.status.booted.composefs? != null)
14-
if is_composefs {
14+
if $is_composefs {
1515
# TODO we don't have imageDigest yet in status
1616
exit 0
1717
}
@@ -24,4 +24,4 @@ let digested_imgref = $"($imgref_untagged)@($digest)"
2424
systemd-run -dqP /bin/env
2525
podman inspect $digested_imgref
2626

27-
tap ok
27+
tap ok

tmt/tests/booted/test-custom-selinux-policy.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def initial_build [] {
2929
RUN mkdir /opt123; echo \"/opt123 /opt\" >> /etc/selinux/targeted/contexts/files/file_contexts.subs_dist
3030
" | save Dockerfile
3131
# Build it
32-
podman build -t localhost/bootc-derived .
32+
podman build --security-opt label=disable -t localhost/bootc-derived .
3333

3434
bootc switch --transport containers-storage localhost/bootc-derived
3535

tmt/tests/booted/test-image-pushpull-upgrade.nu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ COPY usr/ /usr/
4949
RUN echo test content > /usr/share/blah.txt
5050
" | save Dockerfile
5151
# Build it
52-
podman build -t localhost/bootc-derived .
52+
podman build --security-opt label=disable -t localhost/bootc-derived .
5353
# Just sanity check it
54-
let v = podman run --rm localhost/bootc-derived cat /usr/share/blah.txt | str trim
54+
let v = podman run --rm --security-opt label=disable localhost/bootc-derived cat /usr/share/blah.txt | str trim
5555
assert equal $v "test content"
5656

5757
let orig_root_mtime = ls -Dl /ostree/bootc | get modified
@@ -158,7 +158,7 @@ COPY usr/ /usr/
158158
RUN echo test content2 > /usr/share/blah.txt
159159
" | save Dockerfile
160160
# Build it
161-
podman build -t localhost/bootc-derived .
161+
podman build --security-opt label=disable -t localhost/bootc-derived .
162162
let booted_digest = $booted.imageDigest
163163
print $"booted_digest = ($booted_digest)"
164164
# We should already be fetching updates from container storage

tmt/tests/booted/test-logically-bound-switch.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ RUN echo sanity check > /usr/share/bound-image-sanity-check.txt
5555
}
5656

5757
# Build it
58-
podman build -t $name .
58+
podman build --security-opt label=disable -t $name .
5959
# Just sanity check it
60-
let v = podman run --rm $name cat /usr/share/bound-image-sanity-check.txt | str trim
60+
let v = podman run --security-opt label=disable --rm $name cat /usr/share/bound-image-sanity-check.txt | str trim
6161
assert equal $v "sanity check"
6262
}
6363

tmt/tests/booted/test-soft-reboot-selinux-policy.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ EORUN
6565
" | save Dockerfile
6666

6767
# Build the derived image
68-
podman build --quiet -t localhost/bootc-derived-policy .
68+
podman build --quiet --security-opt label=disable -t localhost/bootc-derived-policy .
6969

7070
# Verify soft reboot preparation hasn't happened yet
7171
assert (not ("/run/nextroot" | path exists))

tmt/tests/booted/test-soft-reboot.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def initial_build [] {
3131
RUN echo test content > /usr/share/testfile-for-soft-reboot.txt
3232
" | save Dockerfile
3333
# Build it
34-
podman build -t localhost/bootc-derived .
34+
podman build --security-opt label=disable -t localhost/bootc-derived .
3535

3636
assert (not ("/run/nextroot" | path exists))
3737

@@ -59,7 +59,7 @@ RUN echo test content > /usr/share/testfile-for-soft-reboot.txt
5959
RUN echo 'kargs = ["foo1=bar2"]' | tee /usr/lib/bootc/kargs.d/00-foo1bar2.toml > /dev/null
6060
" | save Dockerfile
6161
# Build it
62-
podman build -t localhost/bootc-derived .
62+
podman build --security-opt label=disable -t localhost/bootc-derived .
6363

6464
bootc upgrade --soft-reboot=auto
6565
let st = bootc status --json | from json

tmt/tests/examples/bootc-bls/build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cp /usr/lib/bootc/initramfs-setup extra/usr/lib/dracut/modules.d/37bootc/bootc-i
1010
mkdir -p tmp
1111

1212
podman build \
13+
--security-opt label=disable \
1314
-t quay.io/fedora/fedora-bootc-bls:42 \
1415
-f Containerfile \
1516
--iidfile=tmp/iid \

0 commit comments

Comments
 (0)