Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #685 from mcastelino/origin/singlevm_bugfix
Browse files Browse the repository at this point in the history
Single VM: Check docker network connectivity
  • Loading branch information
rbradford authored Oct 17, 2016
2 parents 92b2d0e + 735a597 commit 6fd5661
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 10 deletions.
5 changes: 5 additions & 0 deletions testutil/singlevm/tables/workload_template.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
69e84267-ed01-4738-b15f-b47de06b62e7,Fedora 23 Cloud,test.yaml,legacy,qemu,73a86d7e-93c0-480e-9c41-ab42f69b7799,"", 0
e35ed972-c46c-4aad-a1e7-ef103ae079a2,Clear Cloud,test.yaml,efi,qemu,df3768da-31f5-4ba6-82f0-127a1a705169,"", 0
eba04826-62a5-48bd-876f-9119667b1487,CNCI,test.yaml,efi,qemu,4e16e743-265a-4bf2-9fd1-57ada0b28904,"", 1
ca957444-fa46-11e5-94f9-38607786d9ec,Docker Debian latest,docker-debian.yaml,"",docker,fa7d86d8-fa46-11e5-8493-38607786d9ec,"debian:latest",0
ab68111c-03a6-11e6-87de-001320fb6e31,Docker Iperf,docker-iperf.yaml,"",docker,b5e696b8-03a6-11e6-a424-001320fb6e31,"mcastelino/iperf:latest",0
45 changes: 35 additions & 10 deletions testutil/singlevm/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ciao_gobin="$GOPATH"/bin
if [ $? -ne 0 ]
then
echo "FATAL ERROR: Unable to list workloads"
cleanup
exit 1
fi

Expand All @@ -21,7 +20,6 @@ fi
if [ $? -ne 0 ]
then
echo "FATAL ERROR: Unable to launch VMs"
cleanup
exit 1
fi

Expand All @@ -30,16 +28,18 @@ fi
if [ $? -ne 0 ]
then
echo "FATAL ERROR: Unable to list instances"
cleanup
exit 1
fi

"$ciao_gobin"/ciao-cli instance add --workload=ab68111c-03a6-11e6-87de-001320fb6e31 --instances=2
#Launch containers

#Pre-cache the image to reduce the start latency
sudo docker pull debian
"$ciao_gobin"/ciao-cli instance add --workload=ca957444-fa46-11e5-94f9-38607786d9ec --instances=1

if [ $? -ne 0 ]
then
echo "FATAL ERROR: Unable to launch containers"
cleanup
exit 1
fi

Expand All @@ -49,10 +49,30 @@ sleep 5
if [ $? -ne 0 ]
then
echo "FATAL ERROR: Unable to list instances"
cleanup
exit 1
fi

container_1=`sudo docker ps -q -l`
container_1_ip=`sudo docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $container_1`

"$ciao_gobin"/ciao-cli instance add --workload=ca957444-fa46-11e5-94f9-38607786d9ec --instances=1

if [ $? -ne 0 ]
then
echo "FATAL ERROR: Unable to launch containers"
exit 1
fi

sleep 5

"$ciao_gobin"/ciao-cli instance list
if [ $? -ne 0 ]
then
echo "FATAL ERROR: Unable to list instances"
exit 1
fi

container_2=`sudo docker ps -q -l`

#Check SSH connectivity
"$ciao_gobin"/ciao-cli instance list
Expand Down Expand Up @@ -91,15 +111,20 @@ done
if [ $retry -ge 6 ]
then
echo "Unable check ssh connectivity into VM"
cleanup
exit 1
fi

#Check docker networking
echo "Checking Docker Networking"
sleep 30
docker_id=$(sudo docker ps -q | head -1)
sudo docker logs "$docker_id"
sudo docker exec $container_2 /bin/ping -c 3 $container_1_ip

if [ $? -ne 0 ]
then
echo "FATAL ERROR: Unable to ping across containers"
exit 1
else
echo "Container connectivity verified"
fi

#Now delete all instances
"$ciao_gobin"/ciao-cli instance delete --all
Expand Down
5 changes: 5 additions & 0 deletions testutil/singlevm/workloads/docker-debian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
#cloud-config
runcmd:
- [ /bin/bash, -c, "top -b" ]
...

0 comments on commit 6fd5661

Please sign in to comment.