Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add a minimal testing on pkg repo to ensure symlinks are followed and Latest is not being taken in account
Baptiste Daroussin committed 11 years ago
commit b7c968ec6b5eb6cbfc0c3cd454a04d1c9b3d16ae
parent 2d200df
3 files changed +75 -0
modified tests/Makefile.am
@@ -80,6 +80,7 @@ EXTRA_DIST= frontend/png.uclin \
		frontend/pkg.shin \
		frontend/query.sh \
		frontend/register.shin \
+
		frontend/repo.shin \
		frontend/requires.shin \
		frontend/rootdir.shin \
		frontend/rubypuppet.shin \
@@ -110,6 +111,7 @@ check_SCRIPTS= frontend/pkg.sh \
		frontend/php-pr.sh \
		frontend/query.sh \
		frontend/register.sh \
+
		frontend/repo.sh \
		frontend/requires.sh \
		frontend/rootdir.sh \
		frontend/rubypuppet.sh \
modified tests/frontend/Kyuafile
@@ -16,6 +16,7 @@ atf_test_program{name='php-pr.sh'}
atf_test_program{name='pkg.sh'}
atf_test_program{name='query.sh'}
atf_test_program{name='register.sh'}
+
atf_test_program{name='repo.sh'}
atf_test_program{name='requires.sh'}
atf_test_program{name='rootdir.sh'}
atf_test_program{name='rubypuppet.sh'}
added tests/frontend/repo.shin
@@ -0,0 +1,72 @@
+
#! /usr/bin/env atf-sh
+

+
atf_test_case repo
+
repo_head() {
+
	atf_set "descr" "testing pkg repo"
+
}
+

+
repo_body() {
+
	touch plop
+
	touch bla
+
	cat > test.ucl << EOF
+
name: "test"
+
origin: "osef"
+
version: "1"
+
arch: "freebsd:*"
+
maintainer: "test"
+
www: "unknown"
+
prefix: "${TMPDIR}"
+
comment: "need none"
+
desc: "here as well"
+
options: {
+
	"OPT1": "on"
+
	"OPT2": "off"
+
}
+
files: {
+
	"${TMPDIR}/plop": ""
+
	"${TMPDIR}/bla": ""
+
}
+
EOF
+

+
	atf_check \
+
		-o empty \
+
		-e empty \
+
		-s exit:0 \
+
		pkg create -M test.ucl
+

+
	atf_check \
+
		-o inline:"Creating repository in .... done\nPacking files for repository... done\n" \
+
		-e empty \
+
		-s exit:0 \
+
		pkg repo .
+

+
	ln -s test-1.txz test.txz
+

+
	atf_check \
+
		-o inline:"Creating repository in .... done\nPacking files for repository... done\n" \
+
		-e empty \
+
		-s exit:0 \
+
		pkg repo .
+

+
	nb=$(tar -xf digests.txz -O digests | wc -l)
+
	atf_check_equal $nb 2
+

+
	mkdir Latest
+
	ln -s test-1.txz Latest/test.txz
+

+
	atf_check \
+
		-o inline:"Creating repository in .... done\nPacking files for repository... done\n" \
+
		-e empty \
+
		-s exit:0 \
+
		pkg repo .
+

+
	nb=$(tar -xf digests.txz -O digests | wc -l)
+
	atf_check_equal $nb 2
+

+
}
+

+
atf_init_test_cases() {
+
	. $(atf_get_srcdir)/test_environment.sh
+

+
	atf_add_test_case repo
+
}