Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add regression tests about timestamps
Baptiste Daroussin committed 6 years ago
commit 9537258558d263bd4d46c05b491723ceacd9ba40
parent 7738fe2
1 file changed +26 -1
modified tests/frontend/create.sh
@@ -17,7 +17,8 @@ tests_init \
	create_from_plist_pkg_descr \
	create_from_plist_hash \
	create_from_plist_with_keyword_and_message \
-
	create_with_hardlink
+
	create_with_hardlink \
+
	time

genmanifest() {
	cat << EOF >> +MANIFEST
@@ -457,3 +458,27 @@ on install
	atf_check -o inline:"${OUTPUT}" pkg info -D -F ./test-1.txz

}
+

+
time_body() {
+
	atf_check sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1"
+
	cat << EOF >> test.ucl
+
files: {
+
	"${TMPDIR}/a" = "";
+
}
+
EOF
+
	touch a
+
	atf_check pkg create -M test.ucl
+
	atf_check env SOURCE_DATE_EPOCH=86400 pkg create -M test.ucl
+
	atf_check \
+
		-o match:"0 Jan +2 +1970.*/a" \
+
		tar tvf test-1.txz
+
	atf_check -e match:"Invalid" -s exit:64 pkg create -t meh -M test.ucl
+
	atf_check pkg create -t 172800 -M test.ucl
+
	atf_check \
+
		-o match:"0 Jan +3 +1970.*/a" \
+
		tar tvf test-1.txz
+
	atf_check env SOURCE_DATE_EPOCH=86400 pkg create -t 172800 -M test.ucl
+
	atf_check \
+
		-o match:"0 Jan +3 +1970.*/a" \
+
		tar tvf test-1.txz
+
}