From 9c0f0ca1d9a60649cc46980d447c5d567c63cf2d Mon Sep 17 00:00:00 2001 From: Juraj Linkeš Date: Fri, 9 Oct 2020 10:34:08 +0200 Subject: vpp_device: fix shim hostname MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the hacky grep of /etc/resolv.conf with default docker gateway IP. Change-Id: Iec3a4658826f2ba871acb14d511e9c79a1273290 Signed-off-by: Juraj Linkeš --- resources/libraries/bash/function/common.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index e1bf88db9d..2b1a7f5128 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -42,7 +42,6 @@ function activate_docker_topology () { source "${BASH_FUNCTION_DIR}/device.sh" || { die "Source failed!" } - device_image="$(< ${CSIT_DIR}/${IMAGE_VER_FILE})" case_text="${NODENESS}_${FLAVOR}" case "${case_text}" in @@ -50,8 +49,9 @@ function activate_docker_topology () { # We execute reservation over csit-shim-dcr (ssh) which runs sourced # script's functions. Env variables are read from ssh output # back to localhost for further processing. - hostname=$(grep search /etc/resolv.conf | cut -d' ' -f3) || die - ssh="ssh root@${hostname} -p 6022" + # Shim and Jenkins executor are in the same network on the same host + # Connect to docker's default gateway IP and shim's exposed port + ssh="ssh root@172.17.0.1 -p 6022" run="activate_wrapper ${NODENESS} ${FLAVOR} ${device_image}" # The "declare -f" output is long and boring. set +x @@ -333,8 +333,7 @@ function deactivate_docker_topology () { case_text="${NODENESS}_${FLAVOR}" case "${case_text}" in "1n_skx" | "1n_tx2") - hostname=$(grep search /etc/resolv.conf | cut -d' ' -f3) || die - ssh="ssh root@${hostname} -p 6022" + ssh="ssh root@172.17.0.1 -p 6022" env_vars=$(env | grep CSIT_ | tr '\n' ' ' ) || die # The "declare -f" output is long and boring. set +x -- cgit 1.2.3-korg