Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pi-hole/pi-hole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristian König <ckoenig@posteo.de>2022-07-26 15:38:03 +0300
committerChristian König <ckoenig@posteo.de>2022-07-26 15:38:03 +0300
commit7b77d991df712722ae48568e325c5a0bc3df1c65 (patch)
tree188561a37c989f948cb3630de021086280fc2710 /test
parentf59749b1c3aa3554b299099588f240cb6d44365e (diff)
Move FTL port and PID functions to utils.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
Diffstat (limited to 'test')
-rw-r--r--test/test_any_utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_any_utils.py b/test/test_any_utils.py
index b30ff7fd..aaa496cc 100644
--- a/test/test_any_utils.py
+++ b/test/test_any_utils.py
@@ -54,13 +54,13 @@ def test_getFTLAPIPort_default(host):
''' Confirms getFTLAPIPort returns the default API port '''
output = host.run('''
source /opt/pihole/utils.sh
- getFTLAPIPort
+ getFTLAPIPort "/run/pihole-FTL.port"
''')
expected_stdout = '4711\n'
assert expected_stdout == output.stdout
-def test_getFTLAPIPort_custom(host):
+def test_getFTLAPIPortFile_and_getFTLAPIPort_custom(host):
''' Confirms getFTLAPIPort returns a custom API port in a custom PORTFILE location '''
host.run('''
echo "PORTFILE=/tmp/port.file" > /etc/pihole/pihole-FTL.conf
@@ -68,7 +68,8 @@ def test_getFTLAPIPort_custom(host):
''')
output = host.run('''
source /opt/pihole/utils.sh
- getFTLAPIPort
+ FTL_API_PORT=$(getFTLAPIPortFile)
+ getFTLAPIPort "${FTL_API_PORT}"
''')
expected_stdout = '1234\n'
assert expected_stdout == output.stdout