Merge "Nexus retirement CI job clean up"
[ci-management.git] / jjb / scripts / setup_vpp_ubuntu_docker_test.sh
1 #!/bin/bash
2
3 ##############################################################################
4 # Copyright (c) 2021 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11
12 echo "---> jjb/scripts/setup_vpp_ubuntu_docker_test.sh"
13
14 set -e -o pipefail
15
16 OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
17 OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
18
19 if [ -n ${DOCKER_TEST} ] ; then
20         # for 4 cores:
21         # framework.VppTestCase.MIN_REQ_SHM + (num_cores * framework.VppTestCase.SHM_PER_PROCESS)
22         # 1073741824 == 1024M (1073741824 >> 20)
23         MEM=1024M
24         if [[ ${MAKE_PARALLEL_JOBS} == '16' ]]
25         then
26             # arm build are running with 16 cores, empirical evidence shows
27             # that 2048M is enough
28             MEM=2048M
29         fi
30         sudo mount -o remount /dev/shm -o size=${MEM} || true
31         echo "/dev/shm remounted with size='${MEM}'"
32 fi