kolla-ansible/tests/test-zun.sh
Radosław Piliszek d4de1d7520 CI: Zun jobs
- Test Zun on CentOS too
- Make etcd change also trigger Zun jobs (like kuryr and zun)
- Test multinode Zun deployments instead of AIO
  (more likely to break)
- In Zun scenario, stop configuring docker for legacy swarm mode
  (Zun is no swarm)
- Separate test-zun.sh testing script
- Show appcontainer to see which node it has been started on

Change-Id: I289b1009fe00aedb9b78cbd83298b14da5fd9670
Depends-On: https://review.opendev.org/676736
Signed-off-by: Radosław Piliszek <radoslaw.piliszek@gmail.com>
2019-08-16 17:11:00 +02:00

53 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
set -o xtrace
set -o errexit
export PYTHONUNBUFFERED=1
function test_zun_logged {
. /etc/kolla/admin-openrc.sh
. ~/openstackclient-venv/bin/activate
echo "TESTING: Zun"
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 show test
openstack appcontainer delete --force --stop test
echo "SUCCESS: Zun"
}
function test_zun {
echo "Testing Zun"
log_file=/tmp/logs/ansible/test-zun
if [[ -f $log_file ]]; then
log_file=${log_file}-upgrade
fi
test_zun_logged > $log_file 2>&1
result=$?
if [[ $result != 0 ]]; then
echo "Testing Zun failed. See ansible/test-zun for details"
else
echo "Successfully tested Zun. See ansible/test-zun for details"
fi
return $result
}
test_zun