Skip to content

Commit

Permalink
tests: fix rootdir test for today's Fedora
Browse files Browse the repository at this point in the history
Something has changed in the Fedora's Kernel (in F39 or F40?) so that
special files do not work correctly below /tmp:

    $ sudo mknod -m 666 /tmp/null c 1 3
    $ cat /tmp/null
    cat: /tmp/null: Permission denied

This has broken our 22-rootdir.tst - the fix for this is to create the
rootdir below "$HOME" (one of the possibilities).

While touching this file, let's separate the --rootdir directories for
both isolation types.
  • Loading branch information
praiskup committed Jul 16, 2024
1 parent a8cf90f commit a2728fe
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mock/integration-tests/22-rootdir.tst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ fi
. "${TESTDIR}/functions"
set -e

TMPDIR=$(mktemp -d)
cleanup() { rm -rf "$TMPDIR"; }
# creating special files (e.g. /dev/null doesn't work below tmpfs)
WORKDIR=$(mktemp -d -p "$HOME")

cleanup() { rm -rf "$WORKDIR"; }
trap cleanup EXIT

header "mock with --rootdir option"

for isolation in simple nspawn; do
runcmd "$MOCKCMD --isolation=$isolation --rootdir=$TMPDIR --scrub=chroot"
runcmd "$MOCKCMD --isolation=$isolation --rootdir=$TMPDIR --scrub=bootstrap"
runcmd "$MOCKCMD --isolation=$isolation --rootdir=$TMPDIR --bootstrap-chroot ${TESTDIR}/test-C-1.1-0.src.rpm"
rootdir=$WORKDIR/$isolation
runcmd "$MOCKCMD --isolation=$isolation --rootdir=$rootdir --scrub=chroot"
runcmd "$MOCKCMD --isolation=$isolation --rootdir=$rootdir --scrub=bootstrap"
runcmd "$MOCKCMD --isolation=$isolation --rootdir=$rootdir --bootstrap-chroot ${TESTDIR}/test-C-1.1-0.src.rpm"
done

0 comments on commit a2728fe

Please sign in to comment.