#!/bin/bash : "${MOCKCMD=mock}" if test -z "$TESTDIR"; then TESTDIR=$(dirname "$(readlink -f "$0")") fi . ${TESTDIR}/functions header "testing that sign plugin works" confdir=$HOME/.config mkdir -p "$confdir" case $(rpm --eval "%__gpg") in *gpg-mock) ;; *) die "this system is not prepared (run setup-box from remote location)" ;; esac local_config=$confdir/mock.cfg test -f "$local_config" && die "please remove $local_config first" TMPDIR=$(mktemp -d) || die "can't create temporary directory" cat > "$local_config" </dev/null) lines=0 while read -r line; do case $line in "(none)") die "some packages are not signed" ;; *) if test ${#line} -lt 256; then die "weird signature $line" fi ;; esac lines=$(( lines + 1 )) done <<<"$rpmoutput" test $lines -eq 2 || die "two packages are expected to be signed" exit 0