From 45fe91851641a80c2674d32c7c9a4d494f871ef1 Mon Sep 17 00:00:00 2001 From: pvogt09 <50047961+pvogt09@users.noreply.github.com> Date: Fri, 3 Apr 2020 19:46:38 +0200 Subject: [PATCH] fix stickler errors Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com> --- automated install/basic-install.sh | 3 ++- test/test_automated_install.py | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 3d943213..b23ee79e 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1431,7 +1431,8 @@ installConfigs() { # Make the directories if they do not exist and set the owners mkdir -p /run/lighttpd chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /run/lighttpd - local varcache=$(test -d /var/cache; echo $?) + test -d /var/cache + local varcache=$? mkdir -p /var/cache/lighttpd/compress if [[ ! "${varcache}" -eq 0 ]]; then chmod a+rx /var/cache diff --git a/test/test_automated_install.py b/test/test_automated_install.py index 32baba90..0b7792bf 100644 --- a/test/test_automated_install.py +++ b/test/test_automated_install.py @@ -175,7 +175,7 @@ def test_installPihole_fresh_install_readableFiles(Pihole): '0' ), 'restart pihole-FTL': ( - '', + '', '0' ), 'start pihole-FTL': ( @@ -227,7 +227,7 @@ def test_installPihole_fresh_install_readableFiles(Pihole): # check_adlist = test_cmd.format('r', '/etc/pihole/adlists.list', piholeuser) # actual_rc = Pihole.run(check_adlist).rc # assert exit_status_success == actual_rc - #readable and writable dhcp.leases + # readable and writable dhcp.leases check_leases = test_cmd.format('r', '/etc/pihole/dhcp.leases', piholeuser) actual_rc = Pihole.run(check_leases).rc assert exit_status_success == actual_rc @@ -474,8 +474,7 @@ def test_installPihole_fresh_install_readableBlockpage(Pihole, test_webpage): ) FTLcommand = dedent('''\" /etc/init.d/pihole-FTL restart - echo \"''' - ) + echo \"''') mock_command_2( 'systemctl', { @@ -496,7 +495,7 @@ def test_installPihole_fresh_install_readableBlockpage(Pihole, test_webpage): '0' ), 'restart pihole-FTL': ( - FTLcommand, + FTLcommand, '0' ), 'start pihole-FTL': ( @@ -634,7 +633,8 @@ def test_installPihole_fresh_install_readableBlockpage(Pihole, test_webpage): r"failed to open stream: " + r"Permission denied in"), re.I) - status = ('curl -s --head "{}" | ' + + status = ( + 'curl -s --head "{}" | ' + 'head -n 1 | ' + 'grep "HTTP/1.[01] [23].." > /dev/null') pagecontent = 'curl --verbose -L "{}"'