diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-06-28 17:54:22 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-06-28 18:23:25 +0200 |
commit | c55971dbb9021934816d96383450210235890a23 (patch) | |
tree | 5372c94284e7d81605e8f6a6d1e6f5710fc93b92 | |
parent | 6d7bf96c89bdcd9fe5bb30504e4817345f44ffac (diff) | |
download | alpine-conf-c55971dbb9021934816d96383450210235890a23.zip |
lbu: add test for add/delete
-rw-r--r-- | lbu.in | 2 | ||||
-rwxr-xr-x | tests/lbu_test | 22 |
2 files changed, 23 insertions, 1 deletions
@@ -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" } |