cmd = "docker rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
+ def test_212_centos8_build_dockerfile(self):
+ if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
+ testname=self.testname()
+ testdir = self.testdir()
+ dockerfile="testbuilds/centos8-build.dockerfile"
+ addhosts = self.local_addhosts(dockerfile)
+ savename = docname(dockerfile)
+ saveto = SAVETO
+ images = IMAGES
+ cmd = "docker build . -f {dockerfile} {addhosts} --tag {images}:{testname}"
+ sh____(cmd.format(**locals()))
+ cmd = "docker rm --force {testname}"
+ sx____(cmd.format(**locals()))
+ #
+ cmd = "docker rmi {saveto}/{savename}:latest"
+ sx____(cmd.format(**locals()))
+ cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"
+ sh____(cmd.format(**locals()))
+ cmd = "docker rmi {images}:{testname}"
+ sx____(cmd.format(**locals()))
+ self.rm_testdir()
+ def test_222_ubuntu18_build_dockerfile(self):
+ if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
+ testname=self.testname()
+ testdir = self.testdir()
+ dockerfile="testbuilds/ubuntu18-build.dockerfile"
+ addhosts = self.local_addhosts(dockerfile)
+ savename = docname(dockerfile)
+ saveto = SAVETO
+ images = IMAGES
+ cmd = "docker build . -f {dockerfile} {addhosts} --tag {images}:{testname}"
+ sh____(cmd.format(**locals()))
+ cmd = "docker rm --force {testname}"
+ sx____(cmd.format(**locals()))
+ #
+ cmd = "docker rmi {saveto}/{savename}:latest"
+ sx____(cmd.format(**locals()))
+ cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"
+ sh____(cmd.format(**locals()))
+ cmd = "docker rmi {images}:{testname}"
+ sx____(cmd.format(**locals()))
+ self.rm_testdir()
if __name__ == "__main__":