From fd90dcffe08d570b3e3314a6ad1daa778bd2a18f Mon Sep 17 00:00:00 2001 From: Ivan Mikushin Date: Fri, 11 Sep 2015 20:27:00 +0500 Subject: [PATCH] test docker config --- .../cloud-config.yml} | 2 ++ .../rancherostest/test_01_cloud_config.py | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) rename tests/integration/assets/{cloud-config-01.yml => test_01/cloud-config.yml} (78%) diff --git a/tests/integration/assets/cloud-config-01.yml b/tests/integration/assets/test_01/cloud-config.yml similarity index 78% rename from tests/integration/assets/cloud-config-01.yml rename to tests/integration/assets/test_01/cloud-config.yml index a4752b55..ed122464 100644 --- a/tests/integration/assets/cloud-config-01.yml +++ b/tests/integration/assets/test_01/cloud-config.yml @@ -9,5 +9,7 @@ rancher: address: 10.10.2.17/24 gateway: 10.10.2.2 mtu: 1500 + docker: + args: [daemon, --log-opt, max-file=2, --log-opt, max-size=25m, -s, overlay, -G, docker, -H, 'unix:///var/run/docker.sock', -H, 'tcp://0.0.0.0:2375', --userland-proxy=false] ssh_authorized_keys: - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUlsWAL5Rf0Wis/A7k7Tlqx0fZS60VzCZrPZYbP/wkL95jv0XzCx8bd1rZHeybblHPDNpND3BLv4qPY5DxRyexF4seGuzcJI/pOvGUGjQondeMPgDTFEo5w939gSdeTZcfXzQ0wAVhzwDbgH4zPfMzbdoo8Aiu9jkKljXw8IFju0gh+t6iKkGZCIjKT9o7zza1vGfkodhvi2V3VzPdNO28gaxZaRNtmBYUoVnGyR6nXN1Q3CJaVuh5o6GPCOqrhHNbYOFZKBpDiHbxPhVpxHQD2+8yUSGTG7WW75FfZePja5y8d0c/O5L37ZYx4AZAd3KgQYDBT2XCEJGQNawNbfpt diff --git a/tests/integration/rancherostest/test_01_cloud_config.py b/tests/integration/rancherostest/test_01_cloud_config.py index a896644a..90149326 100644 --- a/tests/integration/rancherostest/test_01_cloud_config.py +++ b/tests/integration/rancherostest/test_01_cloud_config.py @@ -1,12 +1,13 @@ import pytest import rancherostest.util as u +import string import subprocess import yaml ssh_command = ['ssh', '-p', '2222', '-F', './assets/scripts_ssh_config', '-i', './tests/integration/assets/test.key', 'rancher@localhost'] -cloud_config_path = './tests/integration/assets/cloud-config-01.yml' +cloud_config_path = './tests/integration/assets/test_01/cloud-config.yml' @pytest.fixture(scope="module") @@ -39,6 +40,20 @@ def test_rancher_environment(qemu, cloud_config): assert v.strip() == cloud_config['rancher']['environment']['FLANNEL_NETWORK'] +@pytest.mark.timeout(40) +def test_docker_args(qemu, cloud_config): + assert qemu is not None + u.wait_for_ssh(ssh_command) + + v = subprocess.check_output( + ssh_command + ['sh', '-c', 'ps -ef | grep docker'], + stderr=subprocess.STDOUT, universal_newlines=True) + + expected = string.join(cloud_config['rancher']['docker']['args']) + + assert v.find(expected) != -1 + + @pytest.mark.timeout(40) def test_rancher_network(qemu, cloud_config): assert qemu is not None