aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/bash/function/common.sh
diff options
context:
space:
mode:
authorThomas F Herbert <therbert@redhat.com>2019-05-18 15:12:52 -0400
committerPeter Mikus <pmikus@cisco.com>2019-06-05 07:46:30 +0000
commitea6e8be86d47b288df5e11ca5515f6bda71dbd08 (patch)
tree379d48c7511a519550839f3bc4fff0b018e4cb4d /resources/libraries/bash/function/common.sh
parent494c42cf77c2571a64854256a68abd7f180cd5d6 (diff)
CSIT changes to support new Centos 7 device testing container image.
CSIT-1505 Parse {os} parameter from job and use it to separate the correct image for each distro and the correct stable package versions. Use two vpp device image names, one for Ubuntu and one for Centos. Centos sut image is in https://hub.docker.com/r/snergster/csit-sut-centos Source for Centos sut image: https://github.com/snergfdio/multivppcache/tree/master/csit-sut-centos Change-Id: I568c82710d730c4ed0ca25bc12cb6074e1cbe27e Signed-off-by: Thomas F Herbert <therbert@redhat.com>
Diffstat (limited to 'resources/libraries/bash/function/common.sh')
-rw-r--r--resources/libraries/bash/function/common.sh31
1 files changed, 30 insertions, 1 deletions
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 () {