2021-07-01 16:31:55 +00:00
|
|
|
#/usr/bin/env bats
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
export ABUILD="$PWD/../abuild"
|
|
|
|
export ABUILD_SHAREDIR="$PWD/.."
|
|
|
|
export ABUILD_CONF=/dev/null
|
2021-12-24 20:52:32 +00:00
|
|
|
export REPODEST="$BATS_TEST_TMPDIR"/packages
|
2021-07-01 16:31:55 +00:00
|
|
|
export CLEANUP="srcdir bldroot pkgdir deps"
|
2021-12-24 20:52:32 +00:00
|
|
|
export WORKDIR="$BATS_TEST_TMPDIR"/work
|
2021-07-01 16:31:55 +00:00
|
|
|
export APORTSDIR="$PWD"/testrepo
|
|
|
|
export PATH="$PWD/../:$PATH"
|
|
|
|
export ARCH=$(apk --print-arch)
|
|
|
|
|
2021-10-11 20:47:50 +00:00
|
|
|
if ! abuild-sign --installed 2>/dev/null; then
|
|
|
|
abuild-keygen -ain >/dev/null 2>&1
|
|
|
|
fi
|
2021-07-01 16:31:55 +00:00
|
|
|
|
2021-12-24 20:52:32 +00:00
|
|
|
mkdir -p "$BATS_TEST_TMPDIR" "$WORKDIR"
|
2021-07-01 16:31:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@test 'abuild-sign: do not record user name/id in index' {
|
|
|
|
cd testrepo/pkg1
|
|
|
|
$ABUILD
|
|
|
|
|
|
|
|
tar tvzf "$REPODEST"/testrepo/"$ARCH"/APKINDEX.tar.gz --numeric-owner|
|
|
|
|
while read -r _ user _ _ _ f; do
|
|
|
|
if [ "$user" != "0/0" ]; then
|
|
|
|
echo "file '$f' is not owned by 0/0 (owned by $user)" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|