Add a podman client test

This commit is contained in:
Joseph Schorr 2019-01-25 17:59:17 -05:00
parent 9e6f2c5be9
commit 72ef93b73c
2 changed files with 35 additions and 3 deletions

View file

@ -3,6 +3,8 @@ from collections import namedtuple
from six import add_metaclass
Command = namedtuple('Command', ['command'])
# NOTE: FileCopy is done via `scp`, instead of `ssh` which is how Command is run.
FileCopy = namedtuple('FileCopy', ['source', 'destination'])
@ -87,3 +89,31 @@ class DockerClient(Client):
def verify(self, registry_host, namespace, name):
yield Command('docker run %s/%s/%s echo testfile' % (registry_host, namespace, name))
class PodmanClient(Client):
def setup_client(self, registry_host):
yield FileCopy('Dockerfile.test', '/home/vagrant/Dockerfile')
def populate_test_image(self, registry_host, namespace, name):
yield Command('sudo podman build -t %s/%s/%s /home/vagrant/' % (registry_host, namespace, name))
def print_version(self):
yield Command('sudo podman version')
def login(self, registry_host, username, password):
yield Command('sudo podman login --tls-verify=false --username=%s --password=%s %s' %
(username, password, registry_host))
def push(self, registry_host, namespace, name):
yield Command('sudo podman push --tls-verify=false %s/%s/%s' % (registry_host, namespace, name))
def pre_pull_cleanup(self, registry_host, namespace, name):
yield Command('sudo podman rmi -f %s/%s/%s' % (registry_host, namespace, name))
yield Command('sudo podman rmi -f quay.io/quay/busybox')
def pull(self, registry_host, namespace, name):
yield Command('sudo podman pull --tls-verify=false %s/%s/%s' % (registry_host, namespace, name))
def verify(self, registry_host, namespace, name):
yield Command('sudo podman run %s/%s/%s echo testfile' % (registry_host, namespace, name))

View file

@ -9,7 +9,7 @@ from threading import Thread
from termcolor import colored
from test.clients.client import DockerClient, Command, FileCopy
from test.clients.client import DockerClient, PodmanClient, Command, FileCopy
def remove_control_characters(s):
return "".join(ch for ch in unicode(s) if unicodedata.category(ch)[0]!="C")
@ -17,6 +17,8 @@ def remove_control_characters(s):
# These tuples are the box&version and the client to use.
BOXES = [
("kleesc/centos7-podman --box-version=0.11.1.1", PodmanClient()), # podman 0.11.1.1
("kleesc/coreos --box-version=1911.4.0", DockerClient()), # docker 18.06.1
("kleesc/coreos --box-version=1800.7.0", DockerClient()), # docker 18.03.1
("kleesc/coreos --box-version=1688.5.3", DockerClient()), # docker 17.12.1
@ -168,8 +170,8 @@ def _run_box(box, client, registry):
_run_commands(client.setup_client(registry))
print colored('>>> Client version', 'cyan')
docker_version = _run_commands(client.print_version())
print _indent(docker_version, 4)
runtime_version = _run_commands(client.print_version())
print _indent(runtime_version, 4)
print colored('>>> Populating test image', 'yellow')
_run_commands(client.populate_test_image(registry, namespace, repo_name))