-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test-getuto.sh: create simple test script
* Fetches simple binpkg * Runs getuto in a temporary directory * Verifies the binpkg against the new keyring Signed-off-by: Sam James <sam@gentoo.org>
- Loading branch information
1 parent
bf56300
commit 6a3c73e
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
libc-1-r1-1.gpkg.tar: | ||
wget https://mirror.bytemark.co.uk/gentoo/releases/amd64/binpackages/17.1/x86-64/virtual/libc/libc-1-r1-1.gpkg.tar -O libc-1-r1-1.gpkg.tar | ||
|
||
check: getuto test-getuto.sh libc-1-r1-1.gpkg.tar | ||
./test-getuto.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -x -e | ||
|
||
whoami() { | ||
# Bypass getuto's check for root as we're going to run in a fake tempdir. | ||
echo root | ||
} | ||
|
||
export -f whoami | ||
# Keep the real root around before we override its value so we can grab a copy of | ||
# gentoo-release.asc. | ||
export REAL_ROOT="${ROOT%/}" | ||
export ROOT="$(mktemp -d)" | ||
|
||
mkdir -p "${ROOT}"/usr/share/openpgp-keys | ||
ln -s "${REAL_ROOT}"/usr/share/openpgp-keys/gentoo-release.asc "${ROOT}"/usr/share/openpgp-keys/gentoo-release.asc | ||
|
||
# Generate a keyring using getuto. | ||
./getuto | ||
|
||
# Make sure the newly-generated keyring works. | ||
export GNUPGHOME="${ROOT%/}"/etc/portage/gnupg | ||
mkdir -p "${ROOT}"/tmp/binpkg | ||
tar xvf libc-1-r1-1.gpkg.tar -C "${ROOT}"/tmp/binpkg | ||
for file in image.tar.bz2 metadata.tar.bz2 ; do | ||
gpg --verify "${ROOT}"/tmp/binpkg/libc-1-r1-1/${file}.sig | ||
done |