X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=jenkins%2Fcommon%2Fcontainer;fp=jenkins%2Fcommon%2Fcontainer;h=400e38aa3ba2f35fdce1b846f89a9361b1e44343;hb=a2813695ca8ac01b88c68cc3a37248fadde1d3ab;hp=5c0ef959036aae7054606315b1029c6b1ca12917;hpb=5cf3216e0e02cb159f906b76e682c038c006aaa9;p=osm%2Fdevops.git diff --git a/jenkins/common/container b/jenkins/common/container index 5c0ef959..400e38aa 100644 --- a/jenkins/common/container +++ b/jenkins/common/container @@ -21,7 +21,7 @@ container_exists() { if [ $# -ne 1 ]; then FATAL "arg is container name" fi - lxc config show $1 2>&1 >/dev/null + lxc config show $1 >/dev/null 2>&1 if [ $? -eq 0 ]; then DEBUG "container $1 exists" return 0 @@ -55,6 +55,12 @@ container_exec() { DEBUG "exec in $container \"$*\"" lxc exec "$container" -- $* } +container_exec_stderr() { + container="$1" + shift + DEBUG "exec in $container \"$*\"" + lxc exec "$container" -- $* 2>&1 +} wait_container_up() { [ $# -eq 1 ] || FATAL "arg is container name got $# args - $*" @@ -62,7 +68,7 @@ wait_container_up() { RE="1 received" while [ $ct -lt 60 ]; do let ct=ct+1 - output=$(container_exec "$1" ping -c 1 google.com) + output=$(container_exec_stderr "$1" ping -c 1 google.com) if [[ $output =~ $RE ]]; then DEBUG "$1 is up" return