diff --git a/tests/abuild_test b/tests/abuild_test index a0e7804..e15a922 100755 --- a/tests/abuild_test +++ b/tests/abuild_test @@ -15,7 +15,8 @@ init_tests \ abuild_checksum_generation \ abuild_checksum_duplicates \ abuild_subpkg_dep_leak \ - abuild_py_providers_creation + abuild_py_providers_creation \ + abuild_reject_init_with_improper_shebang export ABUILD_SHAREDIR=$(atf_get_srcdir)/.. export ABUILD_CONF=/dev/null @@ -309,3 +310,33 @@ abuild_py_providers_creation_body() { cat pkg/.control.py3-foo-and-bar/.PKGINFO } +abuild_reject_init_with_improper_shebang_body() { + mkdir invalid-initd + cd invalid-initd + cat >APKBUILD<<-EOF + # Maintainer: Natanael Copa + pkgname="invalid-initd" + pkgver="1.0" + pkgrel=0 + pkgdesc="Dummy test package" + url="https://gitlab.alpinelinux.org/alpine/aports" + arch="noarch" + license="MIT" + subpackages="" + source="test.initd" + prepare() { + mkdir -p "\$builddir" + } + EOF + cat >test.initd<<-EOF + #!/bin/sh + command="test" + EOF + abuild checksum + + atf_check -s exit:1 \ + -o match:"OK" \ + -e match:"ERROR.*is not an openrc" \ + abuild unpack +} + diff --git a/tests/testrepo/invalid-initd/APKBUILD.in b/tests/testrepo/invalid-initd/APKBUILD.in deleted file mode 100644 index 5f94e4f..0000000 --- a/tests/testrepo/invalid-initd/APKBUILD.in +++ /dev/null @@ -1,21 +0,0 @@ -# Maintainer: Natanael Copa - -# test package -pkgname="invalid-initd" -pkgver="1.0" -pkgrel=0 -pkgdesc="Dummy test package" -url="https://gitlab.alpinelinux.org/alpine/aports" -arch="noarch" -license="MIT" -subpackages="" -source="@source@" -builddir="$srcdir/$pkgname-$pkgver" - -prepare() { - mkdir -p "$builddir" -} - -sha512sums=" -07a068119105559a79f42093bd5c1ec97323b24b485b837ed61f771180143c58715bd22137064639cdda0081e2b294255b5555ddbef98f399c47e2a67c74b058 test.initd -" diff --git a/tests/testrepo/invalid-initd/test.initd b/tests/testrepo/invalid-initd/test.initd deleted file mode 100644 index 0808ab8..0000000 --- a/tests/testrepo/invalid-initd/test.initd +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -command="test"