#!/bin/bash
set -eu

TESTDIR=$(readlink -f $(dirname $0))

if (( APT_TEST_GPGPUBKEY == 0 )); then
	echo 'SKIP (requires the presence of APT_TEST_GPGPUBKEY)' >&2
	exit 0
fi

. $TESTDIR/framework-without-repo

setupenvironment

testpkginstalled 'gpg-pubkey'
# Unless there is a final $, a + of the regex may be interpreted
# as a request to "install", not "remove":
testsuccess aptget -y remove "gpg-pubkey#$EVRDT_re$"
testpkgnotinstalled 'gpg-pubkey'
