X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fcommon.sh;h=399b449fa0cde16ac3a778d2356952e9847c792a;hp=2075f8fbd1b8dc887d69d0cbd1e9ac492d787af1;hb=ea6e8be86d47b288df5e11ca5515f6bda71dbd08;hpb=494c42cf77c2571a64854256a68abd7f180cd5d6 diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index 2075f8fbd1..399b449fa0 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -33,6 +33,7 @@ function activate_docker_topology () { # - TOPOLOGIES - Available topologies. # - NODENESS - Node multiplicity of desired testbed. # - FLAVOR - Node flavor string, usually describing the processor. + # - IMAGE_VER_FILE - Name of file that contains the image version. # Variables set: # - WORKING_TOPOLOGY - Path to topology file. @@ -40,7 +41,7 @@ function activate_docker_topology () { die "Source failed!" } - device_image="$(< ${CSIT_DIR}/VPP_DEVICE_IMAGE)" + device_image="$(< ${CSIT_DIR}/${IMAGE_VER_FILE})" case_text="${NODENESS}_${FLAVOR}" case "${case_text}" in "1n_skx") @@ -760,6 +761,34 @@ function select_vpp_device_tags () { done } +function select_os () { + + set -exuo pipefail + + # Variables read: + # - OS - os or distro for selecting container image. + # Variables set: + # - VPP_VER_FILE - Name of File in CSIT dir containing vpp stable version. + # - IMAGE_VER_FILE - Name of File in CSIT dir containing the image name. + # - PKG_SUFFIX - Suffix of OS package file name, "rpm" or "deb." + + case "${OS}" in + "ubuntu"*) + IMAGE_VER_FILE="VPP_DEVICE_IMAGE_UBUNTU" + VPP_VER_FILE="VPP_STABLE_VER_UBUNTU_BIONIC" + PKG_SUFFIX="deb" + ;; + "centos"*) + IMAGE_VER_FILE="VPP_DEVICE_IMAGE_CENTOS" + VPP_VER_FILE="VPP_STABLE_VER_CENTOS" + PKG_SUFFIX="rpm" + ;; + *) + die "Unable to identify distro or os from ${OS}" + ;; + esac +} + function select_topology () {