X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=resources%2Flibraries%2Fbash%2Ffunction%2Fgather.sh;h=ce1ed5bffcbac2b32fc1e4686e572f9ecacc643d;hb=7e497faf09407bb475ada686a4cee604cc37c130;hp=e3a6a9d1509744167e9da9fab77480a506790fb5;hpb=6da5a6920171682bd5bf6a77517bedfef91cbd0e;p=csit.git diff --git a/resources/libraries/bash/function/gather.sh b/resources/libraries/bash/function/gather.sh index e3a6a9d150..ce1ed5bffc 100644 --- a/resources/libraries/bash/function/gather.sh +++ b/resources/libraries/bash/function/gather.sh @@ -1,5 +1,5 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# Copyright (c) 2021 PANTHEON.tech and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2023 PANTHEON.tech and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -26,7 +26,7 @@ function gather_build () { # Variables read: # - TEST_CODE - String affecting test selection, usually jenkins job name. - # - DOWNLOAD_DIR - Path to directory pybot takes the build to test from. + # - DOWNLOAD_DIR - Path to directory robot takes the build to test from. # Variables set: # - DUT - CSIT test/ subdirectory containing suites to execute. # Directories updated: @@ -57,6 +57,10 @@ function gather_build () { DUT="dpdk" gather_dpdk || die "The function should have died on error." ;; + *"trex"*) + DUT="trex" + gather_trex || die "The function should have died on error." + ;; *) die "Unable to identify DUT type from: ${TEST_CODE}" ;; @@ -88,7 +92,8 @@ function gather_dpdk () { then echo "Downloading latest DPDK packages from repo..." # URL is not in quotes, calling command from variable keeps them. - wget_command=("wget" "--no-check-certificate" "-nv" "-O" "-") + wget_command=("wget" "--no-check-certificate" "--compression=auto") + wget_command+=("-nv" "-O" "-") wget_command+=("${dpdk_repo}") dpdk_stable_ver="$("${wget_command[@]}" | grep -v "2015"\ | grep -Eo 'dpdk-[^\"]+xz' | tail -1)" || { @@ -110,13 +115,23 @@ function gather_dpdk () { fi } +function gather_trex () { + + # This function is required to bypass download dir check. + # Currently it creates empty file in download dir. + # TODO: Add required packages + + set -exuo pipefail + + touch trex-download-to-be-added.txt +} function gather_vpp () { # Variables read: # - BASH_FUNCTION_DIR - Bash directory with functions. # - TEST_CODE - The test selection string from environment or argument. - # - DOWNLOAD_DIR - Path to directory pybot takes the build to test from. + # - DOWNLOAD_DIR - Path to directory robot 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.