diff options
Diffstat (limited to 'resources')
-rwxr-xr-x | resources/libraries/bash/entry/bootstrap_vpp_device.sh | 1 | ||||
-rw-r--r-- | resources/libraries/bash/function/common.sh | 31 | ||||
-rw-r--r-- | resources/libraries/bash/function/gather.sh | 13 |
3 files changed, 39 insertions, 6 deletions
diff --git a/resources/libraries/bash/entry/bootstrap_vpp_device.sh b/resources/libraries/bash/entry/bootstrap_vpp_device.sh index 9605f70a4f..209943fb89 100755 --- a/resources/libraries/bash/entry/bootstrap_vpp_device.sh +++ b/resources/libraries/bash/entry/bootstrap_vpp_device.sh @@ -35,6 +35,7 @@ common_dirs || die get_test_code "${1-}" || die get_test_tag_string || die select_topology || die +select_os || die gather_build || die check_download_dir || die activate_virtualenv || die 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 () { diff --git a/resources/libraries/bash/function/gather.sh b/resources/libraries/bash/function/gather.sh index 518c6b4105..56b148d1e1 100644 --- a/resources/libraries/bash/function/gather.sh +++ b/resources/libraries/bash/function/gather.sh @@ -35,6 +35,7 @@ function gather_build () { # - ${DOWNLOAD_DIR} - Files needed by tests are gathered here. # Functions called: # - die - Print to stderr and exit, defined in common.sh + # - gather_os - Parse os parameter for OS/distro name. # - gather_dpdk, gather_vpp, gather_ligato - See their definitions. # Multiple other side effects are possible, # see functions called from here for their current description. @@ -250,14 +251,16 @@ function gather_vpp () { # - TEST_CODE - The test selection string from environment or argument. # - DOWNLOAD_DIR - Path to directory pybot takes the build to test from. # - CSIT_DIR - Path to existing root of local CSIT git repository. + # Variables set: + # - VPP_VERSION - VPP stable version under test. # Files read: # - ${CSIT_DIR}/DPDK_STABLE_VER - DPDK version to use # by csit-vpp not-timed jobs. - # - ${CSIT_DIR}/VPP_STABLE_VER_UBUNTU - VPP version to use by those. - # - ../vpp*.deb - Relative to ${DOWNLOAD_DIR}, copied for vpp-csit jobs. + # - ${CSIT_DIR}/VPP_STABLE_VER_UBUNTU - Ubuntu VPP version to usee. + # - ../vpp*.deb|rpm - Relative to ${DOWNLOAD_DIR}, copied for vpp-csit jobs. # Directories updated: # - ${DOWNLOAD_DIR}, vpp-*.deb files are copied here for vpp-csit jobs. - # - ./ - Assumed ${DOWNLOAD_DIR}, vpp-*.deb files + # - ./ - Assumed ${DOWNLOAD_DIR}, vpp-*.deb|rpm files # are downloaded here for csit-vpp. # Functions called: # - die - Print to stderr and exit, defined in common_functions.sh @@ -277,7 +280,7 @@ function gather_vpp () { warn "Downloading latest VPP packages from Packagecloud." else warn "Downloading stable VPP packages from Packagecloud." - VPP_VERSION="$(<"${CSIT_DIR}/VPP_STABLE_VER_UBUNTU_BIONIC")" || { + VPP_VERSION="$(<"${CSIT_DIR}/${VPP_VER_FILE}")" || { die "Read VPP stable version failed." } fi @@ -286,7 +289,7 @@ function gather_vpp () { ;; "vpp-csit-"*) # Use locally built packages. - mv "${DOWNLOAD_DIR}"/../"vpp"*".deb" "${DOWNLOAD_DIR}"/ || { + mv "${DOWNLOAD_DIR}"/../"vpp"*".${PKG_SUFFIX}" "${DOWNLOAD_DIR}"/ || { die "Move command failed." } ;; |