Commit Graph

156 Commits

Author SHA1 Message Date
Natanael Copa e8c1ce6127 abuild: fix cleanoldpkg
we should only delete packages of the specified architecture

fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10078
2022-12-06 16:59:03 +01:00
Natanael Copa ee13f777d5 abuild: fix check of maintainer address
Also disallow leading and trailing spaces/quotes.

fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10080
2022-12-02 16:44:53 +01:00
Natanael Copa 21880d296a abuild: add test for -dev subpackage 2022-12-01 15:53:43 +01:00
Natanael Copa b253118cca abuild: add test for -doc subpackages 2022-12-01 15:46:03 +01:00
Natanael Copa f97bf6ae8b abuild-tar: add test for --hash 2022-11-30 13:02:18 +01:00
Natanael Copa 9aeb6484b6 abuild-tar: add test for --cut 2022-11-30 12:19:34 +01:00
Natanael Copa 8a16229d3e abuild-tar: fix --help and add test for usage 2022-11-30 12:00:09 +01:00
Natanael Copa 94122d7bec tests: pre-generate abuild keys
use a fake openssl for abuild-keykey and pre-generate the abuild keys.
This makes tests run significantly faster as we dont need to generate
new keys for each abuild-keygen test.
2022-11-29 09:08:14 +00:00
Kevin Daudt b7813c377c abump: demonstrate abump environment polution
abump sources the APKBUILD to be able to check some variables. When the
APKBUILD exports variables in the global scope, that affects the abump
environment as well.

When abump then executes abuild, it will inherrit the environment from
abump. This is an issue under the following circumstances:

* The APKBUILD only updates the value of an exported variable if it's
  not set
* The default value includes a variable set by abuild, like `$srcdir`.

Because the variable is set by abuild, but not abump, the resulting
exported variable is different. Because it's then set incorrectly in the
abump environment, it's no longer updated with the correct variable when
abuild is invoked.
2022-10-15 10:52:11 +00:00
Natanael Copa 5c542377a8 abuild: fix amove corner cases
fix `amove dir` (without leading or trailing /)

add various testcases for amove
2022-09-23 12:31:56 +02:00
Natanael Copa 8357608d5f tests: functions: add test for empty but set vars
ref https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/112
2022-08-30 10:38:38 +02:00
psykose 927f14f6b3
abuild: fix package size for script-only packages 2022-08-05 16:00:36 +02:00
Natanael Copa 3a235e4d3c tests: adjust to openssl 3
openssl3 have different output to stderr when generating keys. Adjust
accordingly.
2022-08-05 13:22:02 +00:00
ptrcnull 33ce0536ef
abuild: set GIT_CEILING_DIRECTORIES before running prepare/build/check/package 2022-06-22 17:50:38 +02:00
Natanael Copa 4dbf8e3756 abuild-keygen: use doas instead of sudo
fallback to sudo if doas was not found
2022-06-22 16:41:51 +02:00
Natanael Copa 36e1d04f06 tests: abuild: dont copy keys in global scope
this makes it copy keys when generating the list of tests
2022-06-22 16:13:07 +02:00
Natanael Copa ce6e5964b2 tests: port abump tests 2022-06-22 16:13:07 +02:00
Natanael Copa df0eece116 tests: remove abuild.bats
its completely ported now
2022-06-22 16:13:07 +02:00
Natanael Copa 709235bc82 tests: abuild: port mutiline license test 2022-06-22 16:13:07 +02:00
Natanael Copa bd84b91ba9 test: abuild: port invalid pkgname/subpkgname/subpkgversion 2022-06-22 16:13:07 +02:00
Natanael Copa 07894fa745 tests: abuild: port invalid-initd test 2022-06-22 16:13:07 +02:00
Natanael Copa 30b493d4b2 tests: abuild: port and fix py provides generation 2022-06-22 16:13:07 +02:00
Natanael Copa ca29f73dfe tests: abuild: port subpkg-dep-leak test 2022-06-22 16:13:07 +02:00
Natanael Copa 9c67324854 tests: abuild: port duplicate checksum test 2022-06-22 16:13:07 +02:00
Natanael Copa e684847caf tests: add test for checksum generation 2022-06-22 16:13:07 +02:00
Natanael Copa 2e3816d08c tests: abuild: port reproducible build test 2022-06-22 16:13:07 +02:00
Natanael Copa f932f3d32a tests: abuild: add tests for dbg subpackage
Apparently tmpfs does not support extended attributes user namespace, so
ddrop the SETFATTR=false test.
2022-06-22 16:13:07 +02:00
Natanael Copa 35592db050 tests: abuild: add lib64 tests 2022-06-22 16:13:07 +02:00
Natanael Copa 1b66d65805 tests: abuild: add test for invalid filename 2022-06-22 16:13:07 +02:00
Natanael Copa 1913c6929c tests: refacgor abuild build failure 2022-06-22 16:13:07 +02:00
Natanael Copa 209ad1f6ab tests: abuild: add test for simple build 2022-06-22 16:13:07 +02:00
Natanael Copa 4da872b8c9 tests: abuild: test show version 2022-06-22 16:13:07 +02:00
Natanael Copa f69cbe8b96 abuild: show usage on stderr on invalid options 2022-06-22 16:13:07 +02:00
Natanael Copa 0a9f7d1e31 tests: abuild-sign: refactor owner 0/0 test
Refactor test that verifies that owner in tar archive is numeric 0/0
2022-06-22 16:13:07 +02:00
Natanael Copa ea4c0e0eba abuild-sign: fix --installed to detect missing keys 2022-06-22 16:13:07 +02:00
Natanael Copa 97d6a8567d tests: add tests for abuild-sign
Test help text, invalid opts and args, and --installed
2022-06-22 16:13:07 +02:00
Natanael Copa 2326f0c4ef tests: refactor abuild-keygen tests 2022-06-22 16:13:07 +02:00
Natanael Copa ad5697ac44 tests: refactor test for abuild-gzsplit
Also test that the splitted components contains what is expected
2022-06-22 16:13:07 +02:00
Natanael Copa 26938597a0 tests: remove abuild-fetch.bats
It is replaced by abuild_fetch_test
2022-06-22 16:13:07 +02:00
Natanael Copa 14b89510ec tests: abuild-fetch: add test for fetch locking 2022-06-22 16:13:07 +02:00
Natanael Copa 956f452c10 tests: abuild-fetch: use -d to set output dir 2022-06-22 16:13:07 +02:00
Natanael Copa 0fe4de3663 tests: abuild-fetch: test wget --no-check-certificate 2022-06-22 16:13:07 +02:00
Natanael Copa c87b6a47fe tests: abuild-fetch: test wget failure 2022-06-22 16:13:07 +02:00
Natanael Copa 0c40d8aca7 tests: abuild-fetch: test wget fallback 2022-06-22 16:13:07 +02:00
Natanael Copa 684cd989e6 tests: abuild-fetch: add test for http --insecure
when abuild-fetch is used with http source, curl should add --insecure
option. Verify this in a test.
2022-06-22 16:13:07 +02:00
Natanael Copa d7d4eb7d60 tests: abuild-fetch: test curl failure 2022-06-22 16:13:07 +02:00
Natanael Copa 38a62bd063 tests: abuild-fetch: add test for curl invocation 2022-06-22 16:13:07 +02:00
Natanael Copa 911550dbe1 tests: add test for abuild-fetch help 2022-06-22 16:13:07 +02:00
Natanael Copa f24dcff607 tests: functions.sh: test missing git 2022-06-22 16:13:07 +02:00
Natanael Copa b9739f2c3f functions.sh: make it possible to set git binary
to help with testing
2022-06-22 16:13:07 +02:00
Natanael Copa 9dc6b74058 tests: Switch to kyua/atf-test, add tests for functions.sh 2022-06-22 16:13:07 +02:00
Olliver Schinagl f5d6e5e34b abuild: Do not store whitespaces in license field
Currently, abuild stores the license variable ad-verbatim in the PKGINFO
file. This causes many downstream systems to fail. For example, `apk
info` won't show anything after the newline, our webview that lists
licenses do not show these either.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2022-06-14 12:08:01 +00:00
Alex Xu (Hello71) b69e0230d0 tests: use BATS_TEST_TMPDIR, don't dump temp files in repo 2022-05-21 14:23:58 +00:00
Natanael Copa 681ef9dfcf tests: add test with invalid version of subpkgs' dependency
Ref: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10058
2022-01-17 16:17:25 +01:00
Natanael Copa 8824e43ad9 abuild: verify subpkgnames
Refactor pkgname check and also check subpkgnames

Add tests for invalid subpkgnames
2022-01-17 15:44:10 +01:00
Natanael Copa 070341e21d tests: add tests for invalid pkgname
Add s test for valid pkgnames to verify the testsuite APKBUILD actually
works as intended, and a few tests for invalid pkgnames
2022-01-17 15:36:49 +01:00
Kevin Daudt a1975471ab tests/abuild: skip remote initd tests
This test is flaky and relies on a file hosted remotely, which can be
unreachable. Ideally there should a way to have this file served from
the test suite itself, but this might be challenging to do without
adding dependencies.
2021-10-11 23:13:57 +02:00
Kevin Daudt 2a95c3d50c tests: only generate key when not available yet
Installing a build key requires root permissions, something that is not
possible in all cases, most notably on the builders.

Instead of generating a key each time, which results in many keys being
generated each test suite run, check whether a key is already present by
using `abuild-sign --installed`, and only generate a key when that
returns false.
2021-10-11 23:12:59 +02:00
Kevin Daudt a0d6085e9b tests: don't hardcode sudo implementation
Remove the SUDO environment variable, as it depends on what's installed
and configured on the host what implementation should be used.

It would not suffice to add sudo or doas as a makedepend, as it would
also need to be configured to allow abuild-keygen -ain to be executed
without password.
2021-10-11 22:44:43 +02:00
kpcyrd f550705177 abuild-sign: Do not record uid and user name in index 2021-10-11 20:08:51 +02:00
Alex Xu (Hello71) 3ad93d9a83 abuild: default_dbg: various fixes
- fix symlinks
- fix hard links
- fix dbg not first
- fix scan race condition
- fix (non-extended) attrs
- general refactoring
2021-10-11 15:33:01 +00:00
Alex D. ba127ff45c abuild: use sourced filename instead of whole line for initd checks 2021-10-11 14:46:43 +00:00
Kevin Daudt ff913b4907 tests: generate and install keys
abuild requires that a build key is present, so make sure a key is
generated.
2021-10-07 17:25:03 +02:00
Kevin Daudt 789fca23db tests: add project dir to PATH
abuild and abump call a few helpers that are expected to be available in
PATH. As abuild is not installed yet, they are not in the default PATH
locations.

Add the project root dir to $PATH to make sure these helpers can be found.
2021-10-07 17:25:03 +02:00
Kevin Daudt 12ba0a14a2 tests: set APORTSDIR for abuild tests
If `APORTSDIR` is not set, abuild tries to find it. One way it does this
is by trying to look at the url for the git remote 'origin'. This fails
either if there is no git repository, or the git repository has no
remote called 'origin'.

Instead of having abuild guess the location, provide it by exporting
APORTSDIR.
2021-10-07 17:25:01 +02:00
Natanael Copa 3d9918f14d tests: enable colors in git config
Force colors in git config so we can test that we don't get color codes
in our last commit.

ref https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10042
2021-10-07 13:02:25 +02:00
Natanael Copa e510181626 abuild-keygen: make cp non-interactive with -n
only use interactive copy when -n is omitted, so abuild-keygen --install
becomes non-interactive.

Add tests for both ineractive and non-interactive --install.

Fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10049
2021-09-27 20:08:30 +02:00
Natanael Copa dee82f764c tests: skip lock test on s390x
the sleep(0) trick does not appear to work on s390x. which is okish as
worst case we end up with lock file leftovers. skip the test
2021-05-14 12:53:11 +02:00
Natanael Copa 241743073a tests: abump: configure git user 2021-05-14 11:49:38 +02:00
Leo 2ed215fa32 tests(abuild): test whether pyX.Y providers work 2021-05-06 10:50:57 -03:00
Natanael Copa 5f15ae8360 tests: abuild-keygen: test PACKAGER set 2021-05-06 15:30:10 +02:00
Natanael Copa b4816004a1 tests: abuild-keygen: create a fake git
test what happens when git has no user.email configured
2021-05-06 15:30:10 +02:00
Natanael Copa 6a6145b9b3 tests: improve abuild-fetch locking test
make sure that we cover the issue #10026
2021-05-05 17:17:54 +02:00
Natanael Copa 8aacd4783f tests: fix abump to work without configured git user 2021-04-30 15:55:22 +02:00
Natanael Copa 57ec5043f0 tests: fix with busybox sha512sum and misc cleanups 2021-04-30 13:57:20 +02:00
Natanael Copa f23cf180c9 tests: simplify subpkg-dep-leak 2021-04-30 11:14:49 +02:00
Kevin Daudt cf6cd0231f tests: verify subpkg dependencies don't influence main package
Subpackages can declare their own dependencies, but these should not
affect the main package.

Add a test that verifies this behaviour.
2021-04-30 10:43:09 +02:00
Natanael Copa fe2aca3b7d abump: check version before we build 2021-04-29 13:02:10 +02:00
Natanael Copa 1510dbf6fb tests: add tests for abump 2021-04-29 12:45:48 +02:00
Natanael Copa d7150a3fb1 abuild: warn if -dbg is not first in subpackages
fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10002
2021-04-29 11:45:59 +02:00
Natanael Copa db1950c5ce abuild: test for duplicates when doing checksum
fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10013
2021-04-28 13:02:28 +02:00
Natanael Copa c9a4ddf3b4 tests: abuild: fix checksum test
use the correct abuild script

fixes commit e8cfedc2b3 (tests: abuild: test checksum generation)
2021-04-28 12:59:03 +02:00
Natanael Copa a8de7b7f55 tests: add tests for SETFATTR
see https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10027
2021-04-28 10:57:26 +02:00
Natanael Copa b0fb0de17c tests: clean up src and pkg dir after tests 2021-04-28 10:48:54 +02:00
Natanael Copa 39b552751e tests: add test for -dbg package 2021-04-28 10:44:28 +02:00
Natanael Copa 9c3427d16f tests: add tests for abuild-keygen 2021-04-28 10:22:24 +02:00
Natanael Copa d05dd6d9bd tests: abuild: fix test to work with busybox sha512sum
busybox is picky with the spaces in the checksum file.
2021-04-20 16:34:41 +02:00
Natanael Copa b4d975a11f tests: add missing test for invalid filename
fixes commit f35f2aa859 (abuild: add test for invalid filenames)
2021-04-20 16:21:33 +02:00
Natanael Copa 77c21fab30 tests: abuild-fetch test http:// 2021-04-20 13:05:09 +02:00
Natanael Copa e2882e4371 tests: abuild-fetch: add test for file locking
make curl block via a fifo, so we can simulate that it is downloading.
when we want fake that curl is done with the download we write to the
fifo.

We then check that a second invocation of abuild-fetch will block til
the first one is done.
2021-04-20 12:44:38 +02:00
Natanael Copa e8cfedc2b3 tests: abuild: test checksum generation 2021-04-20 11:37:13 +02:00
Natanael Copa cb9ac5be89 tests: abuild-fetch: test wget fallback
if curl is unavailable wget should be called
2021-04-20 11:26:19 +02:00
Natanael Copa d708a813a3 tests: add tests for abuild-fetch 2021-04-20 11:16:23 +02:00
Natanael Copa f35f2aa859 abuild: add test for invalid filenames
reject filenames with newlines

fixes #10024
2021-02-04 14:44:16 +01:00
Natanael Copa 7e754436f1 tests: don't read /etc/abuild.conf
Host's /etc/abuild.conf may enable USE_CCACHE which will pull in ccaches
as makedepends which breaks the tests.

fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10017
2021-01-07 15:21:03 +01:00
Natanael Copa 8ceca11831 ==== release 3.7.0_rc1 ==== 2020-10-29 15:02:23 +00:00
Natanael Copa c3fb176f24 tests: test if build is reproducible 2020-10-29 14:47:30 +00:00
Natanael Copa 614fbc507b tests: add test for lib64 2020-10-29 14:46:46 +00:00
Natanael Copa 5111ca5fc8 tests: clean up build packages after successful build 2020-10-29 14:46:38 +00:00
Natanael Copa 3a75c39860 tests: test for build failure 2020-10-29 13:30:30 +00:00