diff --git a/test/dockerclients/clients_test.py b/test/dockerclients/clients_test.py index e5f8397d9..af2ab46d1 100644 --- a/test/dockerclients/clients_test.py +++ b/test/dockerclients/clients_test.py @@ -1,3 +1,4 @@ +import os import subprocess import sys import time @@ -13,25 +14,43 @@ def remove_control_characters(s): # These tuples are the box&version and whether it requires V1 registry protocol BOXES = [ - ("AntonioMeireles/coreos-stable --box-version=835.8.0", False), - ("AntonioMeireles/coreos-stable --box-version=766.3.0", False), - ("AntonioMeireles/coreos-stable --box-version=681.0.0", False), - ("AntonioMeireles/coreos-stable --box-version=607.0.0", False), - ("AntonioMeireles/coreos-stable --box-version=557.2.0", False), + ("kleesc/coreos --box-version=1911.4.0", False), # docker 18.06.1 + ("kleesc/coreos --box-version=1800.7.0", False), # docker 18.03.1 + ("kleesc/coreos --box-version=1688.5.3", False), # docker 17.12.1 + ("kleesc/coreos --box-version=1632.3.0", False), # docker 17.09.1 + ("kleesc/coreos --box-version=1576.5.0", False), # docker 17.09.0 + ("kleesc/coreos --box-version=1520.9.0", False), # docker 1.12.6 + ("kleesc/coreos --box-version=1235.6.0", False), # docker 1.12.3 + ("kleesc/coreos --box-version=1185.5.0", False), # docker 1.11.2 + + ("kleesc/coreos --box-version=1122.3.0", False), # docker 1.10.3 + ("kleesc/coreos --box-version=899.17.0", False), # docker 1.9.1 + ("kleesc/coreos --box-version=835.13.0", False), # docker 1.8.3 + ("kleesc/coreos --box-version=766.5.0", False), # docker 1.7.1 + ("kleesc/coreos --box-version=717.3.0", False), # docker 1.6.2 + ("kleesc/coreos --box-version=647.2.0", False), # docker 1.5.0 + ("kleesc/coreos --box-version=557.2.0", False), # docker 1.4.1 + ("kleesc/coreos --box-version=522.6.0", False), # docker 1.3.3 - ("yungsang/coreos --box-version=1.3.8", False), - ("yungsang/coreos --box-version=1.3.7", False), - ("yungsang/coreos --box-version=1.2.9", False), - ("yungsang/coreos --box-version=1.1.5", False), - ("yungsang/coreos --box-version=1.0.0", False), - ("yungsang/coreos --box-version=1.0.0", False), - ("yungsang/coreos --box-version=0.9.10", False), - ("yungsang/coreos --box-version=0.9.6", False), + ("yungsang/coreos --box-version=1.3.7", False), # docker 1.3.2 + ("yungsang/coreos --box-version=1.2.9", False), # docker 1.2.0 + ("yungsang/coreos --box-version=1.1.5", False), # docker 1.1.2 + ("yungsang/coreos --box-version=1.0.0", False), # docker 1.0.1 + ("yungsang/coreos --box-version=0.9.10", False), # docker 1.0.0 + ("yungsang/coreos --box-version=0.9.6", False), # docker 0.11.1 - ("yungsang/coreos --box-version=0.9.1", True), + ("yungsang/coreos --box-version=0.9.1", True), # docker 0.10.0 ("yungsang/coreos --box-version=0.3.1", True), ] +def _check_vagrant(): + vagrant_command = 'vagrant' + vagrant = any(os.access(os.path.join(path, vagrant_command), os.X_OK) for path in os.environ.get('PATH').split(':')) + vagrant_plugins = subprocess.check_output([vagrant_command, 'plugin', 'list']) + + return (vagrant, 'vagrant-scp' in vagrant_plugins) + + class CommandFailedException(Exception): pass @@ -110,6 +129,15 @@ def _indent(text, amount): return ''.join((' ' * amount) + line for line in text.splitlines(True)) def _run_box(box, requires_v1, registry): + vagrant, vagrant_scp = _check_vagrant() + if not vagrant: + print("vagrant command not found") + return + + if not vagrant_scp: + print("vagrant-scp plugin not installed") + return + print colored('>>> Box: %s' % box, attrs=['bold']) print colored('>>> Starting box', 'yellow') _run_and_wait(['vagrant', 'destroy', '-f'], error_allowed=True) @@ -143,7 +171,7 @@ def _run_box(box, requires_v1, registry): print colored('>>> Testing login', 'cyan') _run_and_wait(['vagrant', 'ssh', '-c', - 'docker login --username=devtable --password=password --email=foo %s' % registry]) + 'docker login --username=devtable --password=password %s' % registry]) print colored('>>> Testing push', 'cyan') _run_and_wait(['vagrant', 'ssh', '-c', 'docker push %s/devtable/testrepo' % registry])