diff options
| author | Eduardo Gonzalez <dabarren@gmail.com> | 2018-11-12 15:09:31 +0100 |
|---|---|---|
| committer | Eduardo Gonzalez <dabarren@gmail.com> | 2018-12-19 19:50:59 +0100 |
| commit | 362b6ee40e27bcb65289d4d1e0273638d69299ba (patch) | |
| tree | 629295af5dc1cfe63f23a7bbc60e577822fe5c29 /tests | |
| parent | 404d0b1c12b7e69e78c08ad05042d2389c1a8fca (diff) | |
| download | kolla-ansible-362b6ee40e27bcb65289d4d1e0273638d69299ba.tar.gz kolla-ansible-362b6ee40e27bcb65289d4d1e0273638d69299ba.zip | |
Test zun container creation in gates
Change-Id: If5b4ba975a65e07d2704eb6bdb9d841d6a9c3d42
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/get_logs.sh | 2 | ||||
| -rw-r--r-- | tests/templates/globals-default.j2 | 3 | ||||
| -rwxr-xr-x | tests/test-openstack.sh | 23 |
3 files changed, 22 insertions, 6 deletions
diff --git a/tests/get_logs.sh b/tests/get_logs.sh index 094784604..bce497794 100644 --- a/tests/get_logs.sh +++ b/tests/get_logs.sh @@ -37,7 +37,7 @@ copy_logs() { ps -eo user,pid,ppid,lwp,%cpu,%mem,size,rss,cmd > ${LOG_DIR}/system_logs/ps.txt # docker related information - (docker info && docker images && docker ps -a) > ${LOG_DIR}/system_logs/docker-info.txt + (docker info && docker images && docker ps -a && docker network ls) > ${LOG_DIR}/system_logs/docker-info.txt # ceph related logs if [[ $(docker ps --filter name=ceph_mon --format "{{.Names}}") ]]; then diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2 index 3381fb5a0..bb4392c49 100644 --- a/tests/templates/globals-default.j2 +++ b/tests/templates/globals-default.j2 @@ -39,5 +39,6 @@ glance_enable_rolling_upgrade: "yes" {% if scenario == "zun" %} enable_zun: "yes" enable_kuryr: "yes" -docker_custom_option: " -H unix:///var/run/docker.sock -H tcp://{{ api_interface_address }}:2375" +enable_etcd: "yes" +docker_custom_option: " -H unix:///var/run/docker.sock -H tcp://{{ api_interface_address }}:2375 --cluster-store=etcd://{{ api_interface_address }}:2379 --cluster-advertise={{ api_interface_address }}:2375" {% endif %} diff --git a/tests/test-openstack.sh b/tests/test-openstack.sh index 78502f620..d7337822a 100755 --- a/tests/test-openstack.sh +++ b/tests/test-openstack.sh @@ -48,10 +48,25 @@ function test_openstack_logged { if echo $ACTION | grep -q "zun"; then echo "TESTING: Zun" - openstack --debug appcontainer service list - openstack --debug appcontainer host list - # TODO(hongbin): Run a Zun container and assert the container becomes - # Running + openstack appcontainer service list + openstack appcontainer host list + openstack subnet set --no-dhcp demo-subnet + sudo docker pull alpine + sudo docker save alpine | openstack image create alpine --public --container-format docker --disk-format raw + openstack appcontainer run --name test alpine sleep 1000 + attempt=1 + while [[ $(openstack appcontainer show test -f value -c status) != "Running" ]]; do + echo "Container not running yet" + attempt=$((attempt+1)) + if [[ $attempt -eq 10 ]]; then + echo "Container failed to start" + openstack appcontainer show test + return 1 + fi + sleep 10 + done + openstack appcontainer list + openstack appcontainer delete --force --stop test echo "SUCCESS: Zun" fi } |
