Check support files installed and permissions.

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
pull/1244/head
Dan Schaper 8 years ago
parent 8eeb8ad779
commit 4cd598ae10
No known key found for this signature in database
GPG Key ID: 572E999E385B7BFC

@ -1175,8 +1175,8 @@ FTLinstall() {
if sha1sum --status --quiet -c "${binary}".sha1; then
echo -n "transferred... "
install -T -m 0755 /tmp/${binary} /usr/bin/pihole-FTL
touch /var/log/pihole-FTL.log /var/run/pihole-FTL.pid /var/run/pihole-FTL.port
chmod 0666 /var/log/pihole-FTL.log /var/run/pihole-FTL.pid /var/run/pihole-FTL.port
touch /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port
chmod 0644 /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port
cd "${orig_dir}"
echo "done."
return 0
@ -1236,7 +1236,7 @@ FTLdetect() {
binary="pihole-FTL-linux-x86_32"
fi
FTLdownload "${binary}" || return 1
FTLinstall "${binary}" || return 1
}

@ -388,6 +388,20 @@ def test_FTL_binary_installed_and_responsive_no_errors(Pihole):
expected_stdout = 'v'
assert expected_stdout in installed_binary.stdout
def test_FTL_support_files_installed(Pihole):
''' confirms FTL support files are installed '''
support_files = Pihole.run('''
source /opt/pihole/basic-install.sh
FTLdetect
stat -c '%a %n' /var/log/pihole-FTL.log
stat -c '%a %n' /run/pihole-FTL.port
stat -c '%a %n' /run/pihole-FTL.pid
ls -lac /run
''')
assert '644 pihole-FTL.port' in support_files.stdout
assert '644 pihole-FTL.pid' in support_files.stdout
assert '644 pihole-FTL.log' in support_files.stdout
# Helper functions
def mock_command(script, args, container):
''' Allows for setup of commands we don't really want to have to run for real in unit tests '''

Loading…
Cancel
Save