should be pretty much ready, will test tmrw

This commit is contained in:
Bertrand Lanson 2023-04-10 00:42:31 +02:00
parent 9e481a5352
commit 0723d42a73
2 changed files with 16 additions and 8 deletions

View File

@ -29,3 +29,15 @@ def test_docker_interaction(host):
"""Validate interaction with docker."""
docker_ps = host.check_output("docker ps")
assert docker_ps == "CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES"
def test_docker_compose(host):
"""Validate docker-compose installation"""
docker_compose_bin = host.file("/usr/local/bin/docker-compose")
assert not docker_compose_bin.exists
def test_docker_python_package(host):
"""Validate docker python package installation"""
pip_packages_list = host.pip.get_packages(pip_path='pip')
pip_outdated_list = host.pip.get_outdated_packages(pip_path='pip')
assert 'docker' not in pip_packages_list
assert 'docker' not in pip_outdated_list

View File

@ -43,11 +43,7 @@ def test_docker_compose(host):
def test_docker_python_package(host):
"""Validate docker python package installation"""
docker_compose_pattern = r'^Docker Compose version v\d+\.\d+\.\d+$'
docker_compose_bin = host.file("/usr/local/bin/docker-compose")
docker_compose_version = host.check_output("docker-compose --version")
assert docker_compose_bin.exists
assert docker_compose_bin.user == "root"
assert docker_compose_bin.group == "root"
assert docker_compose_bin.mode == 0o755
assert re.match(docker_compose_pattern,docker_compose_version) is not None
pip_packages_list = host.pip.get_packages(pip_path='pip')
pip_outdated_list = host.pip.get_outdated_packages(pip_path='pip')
assert 'docker' in pip_packages_list
assert 'docker' not in pip_outdated_list