Skip to content

Commit

Permalink
tests: add 13-mockchain-gen-br.tst
Browse files Browse the repository at this point in the history
Test that mockchain works, with tmpfs plugin ON (keep_mounted=True),
nocache plugin ON, and dynamic buildrequires package.

Relates: #482, #512, #479
  • Loading branch information
praiskup committed Mar 5, 2020
1 parent 00bb354 commit 0772468
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions mock/integration-tests/13-mockchain-gen-br.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh

if test -z "$TESTDIR"; then
TESTDIR=$(dirname "$(readlink -f "$0")")
fi

. ${TESTDIR}/functions

: "${MOCKCMD=mock}"
: "${MOCKCHAIN=mockchain}"

header "online mockchain, tmpfs.keep_mounted=True, nosync and one package having generated BuildRequires"

test "$(rpm -qa nosync | wc -l)" -eq 2 || die "nosync.x86_64 and nosync.i686 needs to be installed"

confdir=$HOME/.config
mkdir -p "$confdir"
local_config=$confdir/mock.cfg

# cleanup potentially mounted stuff we'll overmount by tmpfs
runcmd "$MOCKCMD --scrub=chroot"
runcmd "$MOCKCMD --scrub=bootstrap"

test -f "$local_config" && die "please remove $local_config first"

cat > "$local_config" <<EOF
config_opts['plugin_conf']['tmpfs_enable'] = True
config_opts['plugin_conf']['tmpfs_opts']['keep_mounted'] = True
config_opts['nosync'] = True
EOF
cleanup() {
rm "$local_config"
}
trap cleanup EXIT

packages="
https://github.com/rpm-software-management/mock-test-data/raw/master/python-copr-999-1.src.rpm
https://github.com/rpm-software-management/mock-test-data/raw/master/dep-on-python-copr-999-1-0.src.rpm
"

eval 'set -- $packages'
runcmd "$MOCKCHAIN $*" || die "mockchain build failed"

0 comments on commit 0772468

Please sign in to comment.