Add arm 1n-tx2 VPP Device jobs
[ci-management.git] / jjb / scripts / setup_vpp_ubuntu_docker_test.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2018 The Linux Foundation and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Eclipse Public License v1.0
7 # which accompanies this distribution, and is available at
8 # http://www.eclipse.org/legal/epl-v10.html
9 ##############################################################################
10 set -e -o pipefail
11
12 OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
13
14 if ! [ -z ${DOCKER_TEST} ] ; then
15         # for 4 cores:
16         # framework.VppTestCase.MIN_REQ_SHM + (num_cores * framework.VppTestCase.SHM_PER_PROCESS)
17         # 1073741824 == 1024M (1073741824 >> 20)
18         MEM=1024M
19         if [[ $(uname -m) == 'aarch64' ]]
20         then
21             # arm build are running with 16 cores, empirical evidence shows
22             # that 2048M is enough
23             MEM=2048M
24         fi
25                 sudo mount -o remount /dev/shm -o size=${MEM} || true
26         echo "/dev/shm remounted"
27 fi
28
29 ##container server node detection
30 grep search /etc/resolv.conf  || true
31
32 if [ "${OS_ID}" == "ubuntu" ]; then
33     dpkg-query -W -f='${binary:Package}\t${Version}\n' || true
34     echo "************************************************************************"
35     echo "pip list:"
36     pip list || true
37     echo "************************************************************************"
38     echo "Contents of /var/cache/vpp/python/virtualenv/lib/python2.7/site-packages:"
39     ls -lth /var/cache/vpp/python/virtualenv/lib/python2.7/site-packages || true
40     echo "************************************************************************"
41     echo "Contents of br Downloads:"
42     ls -lth /w/Downloads || true
43     echo "************************************************************************"
44     echo "Contents of /w/dpdk for test folks:"
45     echo "************************************************************************"
46     ls -lth /w/dpdk || true
47 elif [ "${OS_ID}" == "centos" ]; then
48     yum list installed || true
49     pip list || true
50 elif [ "${OS_ID}" == "opensuse" ]; then
51     yum list installed || true
52     pip list || true
53 elif [ "${OS_ID}" == "opensuse-leap" ]; then
54     yum list installed || true
55     pip list || true
56 fi
57
58 ##This will remove any previously installed dpdk for old branch builds
59
60 if [ "${GERRIT_BRANCH}" != "master" ]; then
61     if [ "${OS_ID}" == "ubuntu" ]; then
62         sudo apt-get -y remove vpp-dpdk-dev || true
63         sudo apt-get -y remove vpp-dpdk-dkms || true
64         sudo apt-get -y remove vpp-ext-deps || true
65     elif [ "${OS_ID}" == "centos" ]; then
66         sudo yum -y erase vpp-dpdk-devel || true
67         sudo yum -y erase vpp-ext-deps || true
68         sudo yum clean all || true
69     elif [ "${OS_ID}" == "opensuse" ]; then
70         sudo yum -y erase vpp-dpdk-devel || true
71         sudo yum -y erase vpp-ext-deps || true
72     elif [ "${OS_ID}" == "opensuse-leap" ]; then
73         sudo yum -y erase vpp-dpdk-devel || true
74         sudo yum -y erase vpp-ext-deps || true
75     fi
76 fi