test: Add host pod ping test

We create a pod with host networking and we try to ping
it from the host.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz 2016-12-21 12:23:52 +01:00
parent 5273bef5d2
commit b6455253c2
No known key found for this signature in database
GPG key ID: 8A803CDD4F566C4A
3 changed files with 102 additions and 0 deletions

View file

@ -245,6 +245,14 @@ function parse_pod_ip() {
done
}
function ping_host_pod() {
pod_ip=`ocic pod status --id $1 | grep "IP Address" | cut -d ' ' -f 3`
ping -W 1 -c 5 $pod_ip
echo $?
}
function ping_pod() {
netns=`ocic pod status --id $1 | grep namespace | cut -d ' ' -f 3`
inet=`ip netns exec \`basename $netns\` ip addr show dev eth0 scope global | grep inet`