+ # Recompile vpp-agent
+ sudo docker exec -i agentcnt \
+ script -qec '. ~/.bashrc; cd /go/src/github.com/ligato/vpp-agent && make generate && make install' || {
+ die 1 "Failed to build vpp-agent in Docker image!"
+ }
+ # Save container state
+ sudo docker commit `sudo docker ps -q` dev_vpp_agent:latest || {
+ die 1 "Failed to commit state of Docker image!"
+ }
+
+ # Build prod_vpp_agent docker image
+ cd docker/prod/ &&\
+ sudo docker build --tag prod_vpp_agent --no-cache . || {
+ die 1 "Failed to build Docker image!"
+ }
+ # Export Docker image
+ sudo docker save prod_vpp_agent | gzip > prod_vpp_agent.tar.gz || {
+ die 1 "Failed to save Docker image!"
+ }
+ DOCKER_IMAGE="$( readlink -f prod_vpp_agent.tar.gz | tr '\n' ' ' )"
+ rm -r ${DOWNLOAD_DIR}/vpp*
+ mv ${DOCKER_IMAGE} ${DOWNLOAD_DIR}/
+ ;;
+ *dpdk*)
+ DUT="dpdk"
+
+ DPDK_REPO='https://fast.dpdk.org/rel/'
+ # Use downloaded packages with specific version
+ if [[ "$TEST_CODE" == *daily* ]] || \
+ [[ "$TEST_CODE" == *weekly* ]] || \
+ [[ "$TEST_CODE" == *timed* ]];
+ then
+ echo "Downloading latest DPDK packages from repo..."
+ DPDK_STABLE_VER=$(wget --no-check-certificate --quiet -O - ${DPDK_REPO} | \
+ grep -v '2015' | grep -Eo 'dpdk-[^\"]+xz' | tail -1)
+ else
+ echo "Downloading DPDK packages of specific version from repo..."
+ DPDK_STABLE_VER='dpdk-18.05.tar.xz'
+ fi
+ if [[ ! -f ${DPDK_STABLE_VER} ]]; then
+ wget --no-check-certificate ${DPDK_REPO}${DPDK_STABLE_VER} || {
+ die 1 "Failed to get DPDK package from ${DPDK_REPO}!"
+ }
+ fi
+ ;;
+ *)
+ die 1 "Unable to identify DUT type from: ${TEST_CODE}!"
+ ;;
+esac
+cd ${SCRIPT_DIR}
+
+if [[ ! "$(ls -A ${DOWNLOAD_DIR})" ]]; then
+ die 1 "No artifacts downloaded!"
+fi
+
+# ENVIRONMENT PREPARATION
+rm -rf env
+
+pip install virtualenv || {
+ die 1 "Failed to install virtual env!"
+}
+virtualenv --system-site-packages env || {
+ die 1 "Failed to create virtual env!"
+}
+source env/bin/activate || {
+ die 1 "Failed to activate virtual env!"
+}
+pip install -r requirements.txt || {
+ die 1 "Failed to install requirements to virtual env!"
+}
+
+# We iterate over available topologies and wait until we reserve topology.