summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lbu.in2
-rwxr-xr-xtests/lbu_test22
2 files changed, 23 insertions, 1 deletions
diff --git a/lbu.in b/lbu.in
index 224f06b..ae4220c 100644
--- a/lbu.in
+++ b/lbu.in
@@ -17,7 +17,7 @@ fi
EXCLUDE_LIST="$sysconfdir"/exclude
INCLUDE_LIST="$sysconfdir"/include
-LBU_LIST="/etc/apk/protected_paths.d/lbu.list"
+LBU_LIST="${ROOT}etc/apk/protected_paths.d/lbu.list"
DEFAULT_CIPHER="aes-256-cbc"
diff --git a/tests/lbu_test b/tests/lbu_test
index 3c23bcf..6cd47b2 100755
--- a/tests/lbu_test
+++ b/tests/lbu_test
@@ -6,6 +6,7 @@ init_tests \
lbu_include_usage \
lbu_inc_usage \
lbu_add_usage \
+ lbu_add_delete \
lbu_commit_usage \
lbu_ci_usage \
lbu_exclude_usage \
@@ -35,6 +36,27 @@ lbu_add_usage_body() {
lbu add -h
}
+lbu_add_delete_body() {
+ init_env
+ mkdir -p root/.ssh
+ atf_check -s exit:0 \
+ -o match:"Adding root/.ssh to" \
+ -e empty \
+ lbu add -v root/.ssh
+
+ atf_check -s exit:0 \
+ -o match:"root/.ssh" \
+ cat etc/apk/protected_paths.d/lbu.list
+
+ atf_check -s exit:0 \
+ -o match:"Removing root/.ssh from" \
+ -e empty \
+ lbu delete -v root/.ssh
+
+ grep 'root/.ssh' etc/apk/protected_paths.d/lbu.list \
+ || atf_fail "root/.ssh was not removed"
+}
+
lbu_commit_usage_body() {
test_usage "lbu commit"
}