summaryrefslogtreecommitdiff
path: root/tests/bin
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2023-01-23 19:28:28 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2023-01-24 10:41:58 +0000
commitf62775fc697446d1d969faa55adcdeca5400b8ea (patch)
tree59b945aa3dcd06915adda27a0b544b5667e917b9 /tests/bin
parentea460f60dc63c6a41b510fdecef03b7a2e1af9a2 (diff)
downloadalpine-conf-f62775fc697446d1d969faa55adcdeca5400b8ea.zip
tests: move fake audit to fake apk
So we can re-use it
Diffstat (limited to 'tests/bin')
-rwxr-xr-xtests/bin/apk15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/bin/apk b/tests/bin/apk
index 8f2a945..df1711c 100755
--- a/tests/bin/apk
+++ b/tests/bin/apk
@@ -9,6 +9,7 @@ fi
rootfs=.
kver=5.15.78-0
+audit_prefix="U "
while [ $# -gt 0 ]; do
case "$1" in
add|del)
@@ -16,13 +17,15 @@ while [ $# -gt 0 ]; do
cmd="$1"
;;
audit)
- echo "U etc/hostname"
- exit 0
+ cmd="$1"
;;
-p|--root)
shift
rootfs="$1"
;;
+ --quiet)
+ audit_prefix=""
+ shift ;;
--arch) shift ;;
--repositories-file) shift ;;
--keys-dir) shift ;;
@@ -33,6 +36,14 @@ while [ $# -gt 0 ]; do
shift
done
+if [ "$cmd" = audit ]; then
+ mkdir -p etc
+ touch etc/hosts etc/localtime
+ echo "${audit_prefix}etc/hosts"
+ echo "${audit_prefix}etc/localtime"
+ exit 0
+fi
+
for pkg in $pkgs; do
case "$pkg" in
linux-firmware*)