tests: abuild: port duplicate checksum test

This commit is contained in:
Natanael Copa 2022-06-20 12:25:23 +02:00
parent e25a2b6fc5
commit 9c67324854

View File

@ -12,7 +12,8 @@ init_tests \
abuild_dbg_subpackage \
abuild_SETFATTR_in_dbg \
abuild_reproducible \
abuild_checksum_generation
abuild_checksum_generation \
abuild_checksum_duplicates
export ABUILD_SHAREDIR=$(atf_get_srcdir)/..
export ABUILD_CONF=/dev/null
@ -241,3 +242,18 @@ abuild_checksum_generation_body() {
sha512sum -c sums || atf_fail "checksum mismatch"
}
abuild_checksum_duplicates_body() {
mkdir -p foo/dir1 foo/dir2
cat > foo/APKBUILD <<-EOF
pkgname="foo"
pkgver="1.0"
source="dir1/testfile dir2/testfile"
EOF
echo "first" > foo/dir1/testfile
echo "second" > foo/dir2/testfile
cd foo
atf_check -s exit:1 \
-e match:"ERROR:.*duplicate found" \
abuild checksum
}