mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-27 09:40:12 +00:00
Move FTL port and PID functions to utils.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
f59749b1c3
commit
7b77d991df
4 changed files with 125 additions and 113 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue