Browse Source

Test zun container creation in gates

Change-Id: If5b4ba975a65e07d2704eb6bdb9d841d6a9c3d42
tags/8.0.0.0b1
Eduardo Gonzalez 1 year ago
parent
commit
362b6ee40e
5 changed files with 24 additions and 7 deletions
  1. +1
    -0
      ansible/roles/zun/defaults/main.yml
  2. +1
    -1
      tests/get_logs.sh
  3. +2
    -1
      tests/templates/globals-default.j2
  4. +19
    -4
      tests/test-openstack.sh
  5. +1
    -1
      tools/setup_gate.sh

+ 1
- 0
ansible/roles/zun/defaults/main.yml View File

@@ -59,6 +59,7 @@ zun_services:
- "{{ kolla_dev_repos_directory ~ '/zun/zun:/var/lib/kolla/venv/lib/python2.7/site-packages/zun' if zun_dev_mode | bool else '' }}"
- "/run:/run:shared"
- "/usr/lib/docker:/usr/lib/docker"
- "/var/lib/docker:/var/lib/docker"
dimensions: "{{ zun_compute_dimensions }}"

####################


+ 1
- 1
tests/get_logs.sh View File

@@ -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


+ 2
- 1
tests/templates/globals-default.j2 View File

@@ -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 %}

+ 19
- 4
tests/test-openstack.sh View File

@@ -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
}


+ 1
- 1
tools/setup_gate.sh View File

@@ -45,7 +45,7 @@ EOF
fi

if [[ $ACTION == "zun" ]]; then
GATE_IMAGES+=",zun,kuryr"
GATE_IMAGES+=",zun,kuryr,etcd"
fi

cat <<EOF | sudo tee /etc/kolla/kolla-build.conf


Loading…
Cancel
Save