2016-08-28 09:15:56 +02:00
|
|
|
''' This file starts with 000 to make it run first '''
|
|
|
|
import pytest
|
|
|
|
import testinfra
|
|
|
|
|
|
|
|
run_local = testinfra.get_backend(
|
|
|
|
"local://"
|
|
|
|
).get_module("Command").run
|
|
|
|
|
2016-10-07 01:51:05 +02:00
|
|
|
@pytest.mark.parametrize("upstream,image,tag", [
|
|
|
|
( 'alpine:edge', 'alpine.docker', 'diginc/pi-hole:alpine' ),
|
|
|
|
( 'debian:jessie', 'debian.docker', 'diginc/pi-hole:debian' ),
|
2017-01-19 03:30:10 +01:00
|
|
|
#( 'jsurf/rpi-raspbian', 'debian-armhf.docker', 'diginc/pi-hole:arm' ),
|
2016-08-28 09:15:56 +02:00
|
|
|
])
|
2016-10-07 01:51:05 +02:00
|
|
|
def test_build_pihole_image(upstream, image, tag):
|
|
|
|
run_local('docker pull {}'.format(upstream))
|
2016-08-28 09:15:56 +02:00
|
|
|
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
|