From 325b0c89358dae042ebfe0ba6dcbcc43253927a6 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 23 Nov 2024 19:59:24 +0100 Subject: Directly call gpgv instead of apt-key --- test/integration/framework | 9 +-------- test/integration/test-method-gpgv | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 19 deletions(-) (limited to 'test/integration') 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 < faked-gpgv <&\${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 [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 ' > 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 [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 -- cgit v1.2.3-70-g09d2