From a7dc09bb463032b33f97fdf2957771d61e91f7bc Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Fri, 13 Nov 2020 15:47:06 +0100 Subject: [PATCH] New test : All incs are removed by 'rm' with empty inc policy --- test/incs.bats | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/incs.bats b/test/incs.bats index 9120503..8f17400 100644 --- a/test/incs.bats +++ b/test/incs.bats @@ -87,6 +87,24 @@ load test_helper assert_failure } +@test "All incs are removed by 'rm' with empty inc policy" { + # Setup empty incs policy + echo "" > "${CONFDIR}/${JAILNAME}.d/incs_policy" + inc_path="${INCSPATH}/${INC_NAME}" + + # Create the inc + /usr/lib/bkctld/bkctld-inc + # Inc should be removed + run test -d "${inc_path}" + assert_success + + # Remove incs + /usr/lib/bkctld/bkctld-rm + # Inc should be removed + run test -d "${inc_path}" + assert_failure +} + @test "empty inc directory are removed" { # Create an inc /usr/lib/bkctld/bkctld-inc