X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fcommon-functions.sh;h=4dd8a1311f7b71453c9817fb2406967a180d329a;hb=refs%2Fchanges%2F61%2F22661%2F1;hp=391d940557256d061e4415098aa07068308c86b1;hpb=bf61379130ca7b39334b3aa05afbe76a4d6d78e5;p=apex.git diff --git a/lib/common-functions.sh b/lib/common-functions.sh index 391d9405..4dd8a131 100644 --- a/lib/common-functions.sh +++ b/lib/common-functions.sh @@ -72,7 +72,7 @@ function attach_interface_to_ovs { if [ -z "$if_mask" ]; then # we can look for PREFIX here, then convert it to NETMASK - if_prefix=$(sed -n 's/^PREFIX=\(.*\)$/\1/p' ${if_file}) + if_prefix=$(sed -n 's/^PREFIX=[^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1/p' ${if_file}) if_mask=$(prefix2mask ${if_prefix}) fi @@ -293,3 +293,16 @@ function verify_internet { return 1 fi } + +##tests if overcloud nodes have external connectivity +#params:none +function test_overcloud_connectivity { + for node in $(undercloud_connect stack ". stackrc && nova list" | grep -Eo "controller-[0-9]+|compute-[0-9]+" | tr -d -) ; do + if ! overcloud_connect $node "ping -c 2 $ping_site > /dev/null"; then + echo "${blue}Node ${node} was unable to ping site ${ping_site}${reset}" + return 1 + fi + done + echo "${blue}Overcloud external connectivity OK${reset}" +} +