mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-27 23:32:21 +00:00
b88efd2527
Co-authored-by: Himanshu Ruhela <himanshuruhela013@gmail.com> Signed-off-by: Adam Warner <me@adamwarner.co.uk>
23 lines
789 B
Python
23 lines
789 B
Python
''' This file starts with 000 to make it run first '''
|
|
import pytest
|
|
import testinfra
|
|
|
|
run_local = testinfra.get_backend(
|
|
"local://"
|
|
).get_module("Command").run
|
|
|
|
|
|
@pytest.mark.parametrize("image,tag", [
|
|
('test/debian.Dockerfile', 'pytest_pihole:debian'),
|
|
('test/centos.Dockerfile', 'pytest_pihole:centos'),
|
|
('test/fedora.Dockerfile', 'pytest_pihole:fedora'),
|
|
])
|
|
# mark as 'build_stage' so we can ensure images are built first when tests
|
|
# are executed in parallel. (not required when tests are executed serially)
|
|
@pytest.mark.build_stage
|
|
def test_build_pihole_image(image, tag):
|
|
build_cmd = run_local('docker build -f {} -t {} .'.format(image, tag))
|
|
if build_cmd.rc != 0:
|
|
print(build_cmd.stdout)
|
|
print(build_cmd.stderr)
|
|
assert build_cmd.rc == 0
|