signed.test 1.78 KB
Newer Older
Bernhard Link's avatar
Bernhard Link committed
1
set -u
2
. "$TESTSDIR"/test.inc
3 4 5

mkdir -p gpgtestdir
export GNUPGHOME="`pwd`/gpgtestdir"
Bernhard Link's avatar
Bernhard Link committed
6
gpg --import $TESTSDIR/good.key
7 8 9 10

mkdir -p conf
cat > conf/distributions <<CONFEND
Codename: ATest
11
Architectures: abacus source
12 13 14 15 16 17 18 19
Components: everything
SignWith: good@nowhere.tld
CONFEND

gpg --list-keys

testrun - -b . export 3<<EOF
stdout
20
$(odb)
21 22 23 24
-v1*=Exporting ATest...
-v2*=Created directory "./dists"
-v2*=Created directory "./dists/ATest"
-v2*=Created directory "./dists/ATest/everything"
25 26 27
-v2*=Created directory "./dists/ATest/everything/binary-abacus"
-v6*= exporting 'ATest|everything|abacus'...
-v6*=  creating './dists/ATest/everything/binary-abacus/Packages' (uncompressed,gzipped)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
-v2*=Created directory "./dists/ATest/everything/source"
-v6*= exporting 'ATest|everything|source'...
-v6*=  creating './dists/ATest/everything/source/Sources' (gzipped)
-v2*=Successfully created './dists/ATest/Release.gpg.new'
-v2*=Successfully created './dists/ATest/InRelease.new'
EOF

find dists/ATest | sort > results
cat > results.expected <<EOF
dists/ATest
dists/ATest/InRelease
dists/ATest/Release
dists/ATest/Release.gpg
dists/ATest/everything
dists/ATest/everything/binary-abacus
dists/ATest/everything/binary-abacus/Packages
dists/ATest/everything/binary-abacus/Packages.gz
dists/ATest/everything/binary-abacus/Release
dists/ATest/everything/source
dists/ATest/everything/source/Release
dists/ATest/everything/source/Sources.gz
EOF

dodiff results.expected results

dodo gpg --verify dists/ATest/Release.gpg dists/ATest/Release
dodo gpg --verify dists/ATest/InRelease

cp dists/ATest/InRelease InRelease
ed -s InRelease <<'EOF'
H
/^-----BEGIN PGP SIGNED MESSAGE-----$/,/^$/d
/^-----BEGIN PGP SIGNATURE-----$/,$d
w
q
EOF
dodiff dists/ATest/Release InRelease

rm -r conf db dists gpgtestdir InRelease results results.expected

Bernhard Link's avatar
Bernhard Link committed
68
testsuccess