summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-11-28 18:25:02 +0000
committerJulian Andres Klode <jak@debian.org>2024-11-28 18:25:02 +0000
commit46e45bf1f4658075f87985d543414e45186e72d2 (patch)
tree7259447c78be773163b348c196f9a59577f40427 /test/integration
parent8d66ab29191c59baac04ef89fac30630cf9535e9 (diff)
parent86f8353ce7a343db7b19422db0d37379ac45ff4e (diff)
Merge branch 'prep-bye-apt-key' into 'main'
Stop using apt-key See merge request apt-team/apt!407
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/framework9
-rwxr-xr-xtest/integration/test-method-gpgv22
2 files changed, 12 insertions, 19 deletions
diff --git a/test/integration/framework b/test/integration/framework
index ad87d17c7..a64488f0e 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -457,15 +457,8 @@ _setupprojectenvironment() {
echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf
echo "Binary::apt::APT::Output-Version \"0\";" >> aptconfig.conf
echo "Dir::Bin::Methods \"${TMPWORKINGDIRECTORY}/rootdir/usr/lib/apt/methods\";" >> aptconfig.conf
- # either store apt-key were we can access it, even if we run it as a different user
- #cp "${APTCMDLINEBINDIR}/apt-key" "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/"
- #chmod o+rx "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/apt-key"
- #echo "Dir::Bin::apt-key \"${TMPWORKINGDIRECTORY}/rootdir/usr/bin/apt-key\";" >> aptconfig.conf
- # destroys coverage reporting though, so we disable changing user for the calling gpgv
- echo "Dir::Bin::apt-key \"${APTCMDLINEBINDIR}/apt-key\";" >> aptconfig.conf
if [ "$(id -u)" = '0' ]; then
- echo 'Binary::gpgv::APT::Sandbox::User "root";' >> aptconfig.conf
- # same for the solver executables
+ # run the solvers as root so we don't lose coverage data
echo 'APT::Solver::RunAsUser "root";' >> aptconfig.conf
echo 'APT::Planner::RunAsUser "root";' >> aptconfig.conf
fi
diff --git a/test/integration/test-method-gpgv b/test/integration/test-method-gpgv
index ffaa72c8f..5ce685c8b 100755
--- a/test/integration/test-method-gpgv
+++ b/test/integration/test-method-gpgv
@@ -7,7 +7,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")"
setupenvironment
configarchitecture 'i386'
-cat > faked-apt-key <<EOF
+cat > faked-gpgv <<EOF
#!/bin/sh
set -e
find_gpgv_status_fd() {
@@ -24,7 +24,7 @@ GPGSTATUSFD="\$(find_gpgv_status_fd "\$@")"
cat >&\${GPGSTATUSFD} gpgv.output
cat gpgv.output
EOF
-chmod +x faked-apt-key
+chmod +x faked-gpgv
testgpgv() {
echo "$4" > gpgv.output
@@ -114,7 +114,7 @@ EOF
gpgvmethod() {
echo "601 Configuration
Config-Item: Debug::Acquire::gpgv=1
-Config-Item: Dir::Bin::apt-key=./faked-apt-key
+Config-Item: APT::Key::GPGVCommand=$PWD/faked-gpgv
Config-Item: APT::Hashes::SHA1::Weak=true
Config-Item: APT::Key::Assert-Pubkey-Algo=>=rsa2048,nistp256,brainpoolP256r1
Config-Item: APT::Key::Assert-Pubkey-Algo::Next=>=rsa2048,nistp256
@@ -130,7 +130,7 @@ testrun
gpgvmethod() {
echo "601 Configuration
Config-Item: Debug::Acquire::gpgv=1
-Config-Item: Dir::Bin::apt-key=./faked-apt-key
+Config-Item: APT::Key::GPGVCommand=$PWD/faked-gpgv
Config-Item: APT::Hashes::SHA1::Weak=true
Config-Item: APT::Key::Assert-Pubkey-Algo=>=rsa2048,nistp256,brainpoolP256r1
Config-Item: APT::Key::Assert-Pubkey-Algo::Next=>=rsa2048,nistp256
@@ -147,7 +147,7 @@ testrun
gpgvmethod() {
echo "601 Configuration
Config-Item: Debug::Acquire::gpgv=1
-Config-Item: Dir::Bin::apt-key=./faked-apt-key
+Config-Item: APT::Key::GPGVCommand=$PWD/faked-gpgv
Config-Item: APT::Hashes::SHA1::Weak=true
Config-Item: APT::Key::Assert-Pubkey-Algo=>=rsa2048,nistp256,brainpoolP256r1
Config-Item: APT::Key::Assert-Pubkey-Algo::Next=>=rsa2048,nistp256
@@ -173,7 +173,7 @@ testsuccess grep 'verified because the public key is not available: GOODSIG' met
gpgvmethod() {
echo "601 Configuration
Config-Item: Debug::Acquire::gpgv=1
-Config-Item: Dir::Bin::apt-key=./faked-apt-key
+Config-Item: APT::Key::GPGVCommand=$PWD/faked-gpgv
Config-Item: APT::Hashes::SHA1::Weak=true
Config-Item: APT::Key::Assert-Pubkey-Algo=>=rsa2048,nistp256,brainpoolP256r1
Config-Item: APT::Key::Assert-Pubkey-Algo::Next=>=rsa2048,nistp256
@@ -204,26 +204,26 @@ setupaptarchive --no-update
echo '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Sebastian Subkey <subkey@example.org>
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2018-08-16 1534459673 0 4 0 1 11 00 4281DEDBD466EAE8C1F4157E5B6896415D44C43E' > gpgv.output
-testsuccess apt update -o Dir::Bin::apt-key="./faked-apt-key" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
+testsuccess apt update -o APT::Key::GPGVCommand="$PWD/faked-gpgv" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
rm -rf rootdir/var/lib/apt/lists
echo '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Sebastian Subkey <subkey@example.org>' > gpgv.output
-testfailure apt update -o Dir::Bin::apt-key="./faked-apt-key" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
+testfailure apt update -o APT::Key::GPGVCommand="$PWD/faked-gpgv" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
rm -rf rootdir/var/lib/apt/lists
echo '[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2018-08-16 1534459673 0 4 0 1 11 00 4281DEDBD466EAE8C1F4157E5B6896415D44C43E' > gpgv.output
-testfailure apt update -o Dir::Bin::apt-key="./faked-apt-key" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
+testfailure apt update -o APT::Key::GPGVCommand="$PWD/faked-gpgv" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
rm -rf rootdir/var/lib/apt/lists
echo '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Sebastian Subkey <subkey@example.org>
[GNUPG:] VALIDSIG 0000000000000000000000000000000000000000 2018-08-16 1534459673 0 4 0 1 11 00 4281DEDBD466EAE8C1F4157E5B6896415D44C43E' > gpgv.output
-testfailure apt update -o Dir::Bin::apt-key="./faked-apt-key" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
+testfailure apt update -o APT::Key::GPGVCommand="$PWD/faked-gpgv" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
rm -rf rootdir/var/lib/apt/lists
gpgvmethod() {
echo "601 Configuration
Config-Item: Debug::Acquire::gpgv=1
-Config-Item: Dir::Bin::apt-key=./faked-apt-key
+Config-Item: APT::Key::GPGVCommand=$PWD/faked-gpgv
Config-Item: APT::Hashes::SHA1::Weak=true
Config-Item: APT::Key::Assert-Pubkey-Algo::Next=>=invalid