summaryrefslogtreecommitdiff
path: root/test/test.d/sourceballs.sh
blob: 1097ae0e5c0577d20762a4bc4c8ea016de23be38 (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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash

curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"

testSourceballs() {
	local arches=('i686' 'x86_64')
	local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch')
	local pkgbase
	local arch

	for pkgbase in "${pkgs[@]}"; do
		for arch in "${arches[@]}"; do
			releasePackage extra "${pkgbase}" "${arch}"
		done
	done
	../db-update

	../cron-jobs/sourceballs
	for pkgbase in "${pkgs[@]}"; do
		[ ! -r "${FTP_BASE}/${SRCPOOL}/${pkgbase}"-*"${SRCEXT}" ] && fail "source package not found!"
	done
}

testAnySourceballs() {
	local pkgs=('pkg-any-a' 'pkg-any-b')
	local pkgbase

	for pkgbase in "${pkgs[@]}"; do
		releasePackage extra "${pkgbase}" any
	done
	../db-update

	../cron-jobs/sourceballs
	for pkgbase in "${pkgs[@]}"; do
		[ ! -r "${FTP_BASE}/${SRCPOOL}/${pkgbase}"-*"${SRCEXT}" ] && fail "source package not found!"
	done
}

testSplitSourceballs() {
	local arches=('i686' 'x86_64')
	local pkgs=('pkg-split-a' 'pkg-split-b')
	local pkg
	local pkgbase
	local arch

	for pkgbase in "${pkgs[@]}"; do
		for arch in "${arches[@]}"; do
			releasePackage extra "${pkgbase}" "${arch}"
		done
	done

	../db-update

	../cron-jobs/sourceballs
	for pkgbase in "${pkgs[@]}"; do
		[ ! -r "${FTP_BASE}/${SRCPOOL}/${pkgbase}"-*"${SRCEXT}" ] && fail "source package not found!"
	done
}

testSourceballsCleanup() {
	local arches=('i686' 'x86_64')
	local pkgs=('pkg-simple-a' 'pkg-simple-b')
	local pkgbase
	local arch

	for pkgbase in "${pkgs[@]}"; do
		for arch in "${arches[@]}"; do
			releasePackage extra "${pkgbase}" "${arch}"
		done
	done
	../db-update
	../cron-jobs/sourceballs

	for arch in "${arches[@]}"; do
		../db-remove extra "${arch}" pkg-simple-a
	done

	../cron-jobs/sourceballs
	[ -r "${FTP_BASE}/${SRCPOOL}/pkg-simple-a"-*"${SRCEXT}" ] && fail "source package was not removed!"
	[ ! -r "${FTP_BASE}/${SRCPOOL}/pkg-simple-b"-*"${SRCEXT}" ] && fail "source package not found!"
}

. "${curdir}/../lib/shunit2"