setup_vpp_ubuntu_docker_test.sh revision afbd4e11
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##############################################################################
10set -e -o pipefail
11
12OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
13
14if ! [ -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		sudo mount -o remount /dev/shm -o size=1024M || true
19        echo "/dev/shm remounted"
20fi
21
22##container server node detection
23grep search /etc/resolv.conf  || true
24
25if [ "${OS_ID}" == "ubuntu" ]; then
26    dpkg-query -W -f='${binary:Package}\t${Version}\n' || true
27    echo "************************************************************************"
28    echo "pip list:"
29    pip list || true
30    echo "************************************************************************"
31    echo "Contents of /var/cache/vpp/python/virtualenv/lib/python2.7/site-packages:"
32    ls -lth /var/cache/vpp/python/virtualenv/lib/python2.7/site-packages || true
33    echo "************************************************************************"
34    echo "Contents of br Downloads:"
35    ls -lth /w/Downloads || true
36    echo "************************************************************************"
37    echo "Contents of /w/dpdk for test folks:"
38    echo "************************************************************************"
39    ls -lth /w/dpdk || true
40elif [ "${OS_ID}" == "centos" ]; then
41    yum list installed || true
42    pip list || true
43elif [ "${OS_ID}" == "opensuse" ]; then
44    yum list installed || true
45    pip list || true
46fi
47
48##This will remove any previously installed dpdk for old branch builds
49
50if [ "${GERRIT_BRANCH}" != "master" ]; then
51    if [ "${OS_ID}" == "ubuntu" ]; then
52        sudo apt-get -y remove vpp-dpdk-dev || true
53        sudo apt-get -y remove vpp-dpdk-dkms || true
54        sudo apt-get -y remove vpp-ext-deps || true
55    elif [ "${OS_ID}" == "centos" ]; then
56        sudo yum -y erase vpp-dpdk-devel || true
57        sudo yum -y erase vpp-ext-deps || true
58        sudo yum clean all || true
59    elif [ "${OS_ID}" == "opensuse" ]; then
60        sudo yum -y erase vpp-dpdk-devel || true
61        sudo yum -y erase vpp-ext-deps || true
62    fi
63fi
64