X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fgather.sh;h=4958e5251b8d35132a12634977dfe71fdb5f8e55;hb=eea1611300a7e80694173b0c448865a772746434;hp=429a2cc91fdcef9890f75a8879c9c4d4a8db2733;hpb=7de465c09018b1cf739a28992fe198ccd5f5699d;p=csit.git diff --git a/resources/libraries/bash/function/gather.sh b/resources/libraries/bash/function/gather.sh index 429a2cc91f..4958e5251b 100644 --- a/resources/libraries/bash/function/gather.sh +++ b/resources/libraries/bash/function/gather.sh @@ -1,5 +1,5 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. -# Copyright (c) 2019 PANTHEON.tech and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2021 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: @@ -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}" ;; @@ -110,6 +114,16 @@ 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 () { @@ -123,11 +137,12 @@ function gather_vpp () { # Files read: # - ${CSIT_DIR}/DPDK_STABLE_VER - DPDK version to use # by csit-vpp not-timed jobs. - # - ${CSIT_DIR}/VPP_STABLE_VER_UBUNTU - Ubuntu VPP version to usee. - # - ../vpp*.deb|rpm - Relative to ${DOWNLOAD_DIR}, copied for vpp-csit jobs. + # - ${CSIT_DIR}/${VPP_VER_FILE} - Ubuntu VPP version to use. + # - ../*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|rpm 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 @@ -141,9 +156,10 @@ function gather_vpp () { "csit-"*) # Use downloaded packages with specific version. if [[ "${TEST_CODE}" == *"daily"* ]] || \ - ([[ "${TEST_CODE}" == *"weekly"* ]] && \ - [[ "${TEST_CODE}" != *"device"* ]]) || \ - [[ "${TEST_CODE}" == *"semiweekly"* ]]; + { [[ "${TEST_CODE}" == *"weekly"* ]] && \ + [[ "${TEST_CODE}" != *"device"* ]]; } || \ + [[ "${TEST_CODE}" == *"semiweekly"* ]] || \ + [[ "${TEST_CODE}" == *"hourly"* ]]; then warn "Downloading latest VPP packages from Packagecloud." else @@ -156,8 +172,10 @@ function gather_vpp () { download_artifacts || die ;; "vpp-csit-"*) + # Shorten line. + pgks="${PKG_SUFFIX}" # Use locally built packages. - mv "${DOWNLOAD_DIR}"/../"vpp"*".${PKG_SUFFIX}" "${DOWNLOAD_DIR}"/ || { + mv "${DOWNLOAD_DIR}"/../*vpp*."${pkgs}" "${DOWNLOAD_DIR}"/ || { die "Move command failed." } ;;