adjustment to custom interface tests to reflect new default behaviour in https://github.com/pi-hole/pi-hole/pull/4509

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2022-01-05 22:47:16 +00:00
parent 2567ab9940
commit 4cc3587084
No known key found for this signature in database
GPG Key ID: 872950F3ECF2B173
1 changed files with 4 additions and 5 deletions

View File

@ -143,16 +143,15 @@ def test_DNS_Envs_are_secondary_to_setupvars(Docker, Slow, args_env, expected_st
expected_servers)
@pytest.mark.parametrize('args_env, expected_stdout, expected_config_line', [
('', 'binding to default interface: eth0', 'interface=eth0' ),
('-e INTERFACE="eth0"', 'binding to default interface: eth0', 'interface=eth0' ),
('-e INTERFACE="br0"', 'binding to custom interface: br0', 'interface=br0'),
@pytest.mark.parametrize('args_env, expected_stdout, expected_config_line', [
('', 'binding to default interface: eth0', 'PIHOLE_INTERFACE=eth0'),
('-e INTERFACE="br0"', 'binding to custom interface: br0', 'PIHOLE_INTERFACE=br0'),
])
def test_DNS_interface_override_defaults(Docker, Slow, args_env, expected_stdout, expected_config_line):
''' When INTERFACE environment var is passed in, overwrite dnsmasq interface '''
function = Docker.run('. /bash_functions.sh ; eval `grep "^setup_dnsmasq " /start.sh`')
assert expected_stdout in function.stdout
Slow(lambda: expected_config_line + '\n' == Docker.run('grep "^interface" /etc/dnsmasq.d/01-pihole.conf').stdout)
Slow(lambda: expected_config_line + '\n' == Docker.run('grep "^PIHOLE_INTERFACE" /etc/pihole/setupVars.conf').stdout)
expected_debian_lines = [