summaryrefslogtreecommitdiff
path: root/test/test.d/signed-packages.sh
blob: 148929f9284625e0de5f6b67dd1b29d6c56984e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
testAddSignedPackage() {
	releasePackage extra 'pkg-simple-a' 'i686'
	../db-update || fail "db-update failed!"
}

testAddUnsignedPackage() {
	releasePackage extra 'pkg-simple-a' 'i686'
	rm "${STAGING}"/extra/*.sig
	../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is missing!"
}

testAddInvalidSignedPackage() {
	local p
	releasePackage extra 'pkg-simple-a' 'i686'
	for p in "${STAGING}"/extra/*${PKGEXT}; do
		unxz $p
		xz -0 ${p%%.xz}
	done
	../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is invalid!"
}

testAddBrokenSignature() {
	local s
	releasePackage extra 'pkg-simple-a' 'i686'
	for s in "${STAGING}"/extra/*.sig; do
		echo 0 > $s
	done
	../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is broken!"
}