From 2dfa0ee7d2499c7295fe45acd6aa7a8eda53ae11 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 12 May 2021 18:47:13 +0200 Subject: [PATCH] test --- include.sh | 4 ++++ install.sh | 2 +- specs/astrXbian_spec.sh | 34 +++++++++++++++++++--------------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/include.sh b/include.sh index b31791b..0574219 100644 --- a/include.sh +++ b/include.sh @@ -32,6 +32,10 @@ i_am_root() { [ $(id -u) -eq 0 ] } +i_am_xbian() { + [[ "$USER" == "xbian" ]] +} + i_should_install() { [[ ! -f ~/.zen/secret.june ]] } diff --git a/install.sh b/install.sh index f511a2b..6e80ca9 100755 --- a/install.sh +++ b/install.sh @@ -35,7 +35,7 @@ check_jaklis echo "Sécurisation DEFCON SUDOERS FAIL2BAN" ## XBIAN fail2ban ERROR correction ## #[....] Starting authentication failure monitor: fail2ban No file(s) found for glob /var/log/auth.log -[[ "$USER" == "xbian" ]] && sudo sed -i "s/auth.log/faillog/g" /etc/fail2ban/paths-common.conf +i_am_xbian && sudo sed -i "s/auth.log/faillog/g" /etc/fail2ban/paths-common.conf # NODE activates fail2ban IN zen/ipfs_SWARM_refresh.sh ### MODIFIYING /etc/sudoers ### diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh index a8044a4..563efcb 100644 --- a/specs/astrXbian_spec.sh +++ b/specs/astrXbian_spec.sh @@ -3,6 +3,21 @@ Describe 'AstrXbian' Describe 'install()' Include ./include.sh + It 'should check IPFS, but not tested' + Pending "You should implement check_ipfs tests" + When call check_ipfs + The status should be success + End + It 'should check Jaklis, but not tested' + Pending "You should implement check_jaklis tests" + When call check_jaklis + The status should be success + End + It 'should check requirements, but not tested' + Pending "You should implement check_requirements tests" + When call check_requirements + The status should be success + End It 'should be me' When call i_am The output should eq 'v0.4' @@ -11,13 +26,12 @@ Describe 'AstrXbian' When call i_am_root The status should not be success End - It 'should install AstrXbian' - When call i_should_install + It 'should be xbian' + When call i_am_xbian The status should be success End - It 'should check requirements, but not tested' - Pending "You should implement check_requirements tests" - When call check_requirements + It 'should install AstrXbian' + When call i_should_install The status should be success End It 'should import AstrXbian, but not tested' @@ -30,15 +44,5 @@ Describe 'AstrXbian' When call import_kodi The status should be success End - It 'should check IPFS, but not tested' - Pending "You should implement check_ipfs tests" - When call check_ipfs - The status should be success - End - It 'should check Jaklis, but not tested' - Pending "You should implement check_jaklis tests" - When call check_jaklis - The status should be success - End End End