diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2023-01-23 15:31:04 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2023-01-24 10:41:58 +0000 |
commit | ea460f60dc63c6a41b510fdecef03b7a2e1af9a2 (patch) | |
tree | ffdfd082ed25272815f8da4c072ae4ea8dceb187 | |
parent | 4f5e613ab51fe2d630d1300335f640782752a19b (diff) | |
download | alpine-conf-ea460f60dc63c6a41b510fdecef03b7a2e1af9a2.zip |
tests: add fake apk audit
useful for `lbu package`
-rwxr-xr-x | tests/bin/apk | 7 | ||||
-rwxr-xr-x | tests/fake_apk_test | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tests/bin/apk b/tests/bin/apk index 29da9ba..8f2a945 100755 --- a/tests/bin/apk +++ b/tests/bin/apk @@ -7,15 +7,18 @@ if [ "$1" = "--print-arch" ]; then exit fi -echo "DEBUG: fake apk" "$@" - rootfs=. kver=5.15.78-0 while [ $# -gt 0 ]; do case "$1" in add|del) + echo "DEBUG: fake apk" "$@" cmd="$1" ;; + audit) + echo "U etc/hostname" + exit 0 + ;; -p|--root) shift rootfs="$1" diff --git a/tests/fake_apk_test b/tests/fake_apk_test index 84c80ec..8ceba87 100755 --- a/tests/fake_apk_test +++ b/tests/fake_apk_test @@ -22,3 +22,12 @@ fake_apk_add_body() { find } +fake_apk_audit_body() { + init_env + mkdir etc + echo "foo" > etc/hostname + atf_check -s exit:0 \ + -o no-match:"DEBUG: fake apk" \ + -o match:"U etc/hostname" \ + apk audit +} |