Merge "feat(csit): Add T-Rex 1n-aws job"
[ci-management.git] / jjb / scripts / setup_vpp_ubuntu_docker_test.sh
old mode 100644 (file)
new mode 100755 (executable)
index 1828174..548ac56
@@ -1,33 +1,32 @@
 #!/bin/bash
+
 ##############################################################################
-# Copyright (c) 2018 The Linux Foundation and others.
+# Copyright (c) 2021 The Linux Foundation and others.
 #
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
 # http://www.eclipse.org/legal/epl-v10.html
 ##############################################################################
+
+echo "---> jjb/scripts/setup_vpp_ubuntu_docker_test.sh"
+
 set -e -o pipefail
 
 OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
 
-if ! [ -z ${DOCKER_TEST} ] ; then
-               mount -o remount /dev/shm -o size=512M || true
-        echo "/dev/shm remounted"
-fi
-
-if [ "${OS_ID}" == "ubuntu" ]; then
-    dpkg-query -W -f='${binary:Package}\t${Version}\n'
-    pip list
-elif [ "${OS_ID}" == "centos" ]; then
-    yum list installed
-    pip list
-elif [ "${OS_ID}" == "opensuse" ]; then
-    yum list installed
-    pip list
+if [ -n ${DOCKER_TEST} ] ; then
+        # for 4 cores:
+        # framework.VppTestCase.MIN_REQ_SHM + (num_cores * framework.VppTestCase.SHM_PER_PROCESS)
+        # 1073741824 == 1024M (1073741824 >> 20)
+        MEM=1024M
+        if [[ ${MAKE_PARALLEL_JOBS} == '16' ]]
+        then
+            # arm build are running with 16 cores, empirical evidence shows
+            # that 2048M is enough
+            MEM=2048M
+        fi
+       sudo mount -o remount /dev/shm -o size=${MEM} || true
+        echo "/dev/shm remounted with size='${MEM}'"
 fi
-if [ "x${IS_CSIT_VPP_JOB}" == "xTrue" ]; then
-       (cd dpdk ; apt-get download vpp-dpdk-dkms > /dev/null 2>&1) || true
-    ls -l dpdk/*.deb || true
-    echo "csit vpp-dpdk-dkms package download"
-fi
\ No newline at end of file