dataset/seed/dns-external/tests/test_dns_external.py
2022-07-04 15:44:18 +02:00

17 lines
491 B
Python

from yaml import load, SafeLoader
from os import environ
from execute import run
EXTERNAL_DOMAIN = 'google.fr'
def test_dns_external():
conf_file = f'{environ["MACHINE_TEST_DIR"]}/dns-local.yml'
with open(conf_file) as yaml:
data = load(yaml, Loader=SafeLoader)
result = run(data['address'],
['/bin/resolvectl', 'query', EXTERNAL_DOMAIN],
)
assert 'resolve call failed' not in next(result), f'cannot resolved {EXTERNAL_DOMAIN}'