Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add a test regarding simple fetching
Baptiste Daroussin committed 5 years ago
commit e9453515ae3fc18c4de8928b49200894069846fa
parent 96406ff
1 file changed +29 -1
modified tests/frontend/http.sh
@@ -3,7 +3,8 @@
. $(atf_get_srcdir)/test_environment.sh

tests_init \
-
	simple_repo
+
	simple_repo \
+
	simple_fetch

cleanup() {
	pkill -15 -F ${TMPDIR}/http.pid
@@ -37,3 +38,30 @@ EOF
	atf_check -o match:"Installing test-1" \
		pkg -C ./pkg.conf install -y test
}
+

+
simple_fetch_body()
+
{
+
	pidfile=${TMPDIR}/http.pid
+
	touch ${pidfile}
+

+
	atf_require mini_httpd "Requires mini_httpd to run this test"
+

+
	mkdir rootdir
+
	cat > ${TMPDIR}/rootdir/meh <<EOF
+
<?xml version="1.0" encoding="utf-8"?>
+
<vuxml xmlns="http://www.vuxml.org/apps/vuxml-1">
+
</vuxml>
+
EOF
+
	bzip2 ${TMPDIR}/rootdir/meh
+

+
	trap cleanup EXIT
+
	atf_check -o empty -e empty mini_httpd -h 127.0.0.1 -p 64242 -d ${TMPDIR}/rootdir -dd ${TMPDIR}/rootdir -i ${pidfile}
+

+
	cat > pkg.conf << EOF
+
PKG_DBDIR=${TMPDIR}
+
VULNXML_SITE = "http://localhost:64242/meh.bz2"
+
EOF
+

+
	atf_check -o ignore pkg -C ./pkg.conf audit -F
+

+
}