Skip to content

Commit a6f5e39

Browse files
committed
travis CI: Trim down the linux-build.sh
We don't need to prepare or configure datapath or dpdk. We also don't need to run on many kernel versions. Acked-by: Ben Pfaff <[email protected]> Signed-off-by: Numan Siddique <[email protected]>
1 parent c17862f commit a6f5e39

File tree

2 files changed

+3
-109
lines changed

2 files changed

+3
-109
lines changed

.travis.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,9 @@ before_script: export PATH=$PATH:$HOME/bin
2828

2929
env:
3030
- OPTS="--disable-ssl"
31-
- TESTSUITE=1 KERNEL=3.16.54
31+
- TESTSUITE=1 KERNEL=4.18.20
3232
- TESTSUITE=1 OPTS="--enable-shared"
3333
- BUILD_ENV="-m32" OPTS="--disable-ssl"
34-
- KERNEL=3.16.54 DPDK=1 OPTS="--enable-shared"
35-
- KERNEL=3.16.54 TESTSUITE=1 DPDK=1
36-
- KERNEL=3.16.54 DPDK_SHARED=1
37-
- KERNEL=3.16.54 DPDK_SHARED=1 OPTS="--enable-shared"
38-
- KERNEL=4.18.20
39-
- KERNEL=4.17.19
40-
- KERNEL=4.16.18
41-
- KERNEL=4.15.18
42-
- KERNEL=4.14.63
43-
- KERNEL=4.9.149
44-
- KERNEL=4.4.148
45-
- KERNEL=3.19.8
46-
- KERNEL=3.16.57
4734
- TESTSUITE=1 LIBS=-ljemalloc
4835

4936
matrix:

.travis/linux-build.sh

Lines changed: 2 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -3,105 +3,16 @@
33
set -o errexit
44
set -x
55

6-
KERNELSRC=""
76
CFLAGS="-Werror"
87
SPARSE_FLAGS=""
98
EXTRA_OPTS=""
109
TARGET="x86_64-native-linuxapp-gcc"
1110

12-
function install_kernel()
13-
{
14-
if [[ "$1" =~ ^4.* ]]; then
15-
PREFIX="v4.x"
16-
elif [[ "$1" =~ ^3.* ]]; then
17-
PREFIX="v3.x"
18-
else
19-
PREFIX="v2.6/longterm/v2.6.32"
20-
fi
21-
22-
wget https://cdn.kernel.org/pub/linux/kernel/${PREFIX}/linux-${1}.tar.xz
23-
tar xvf linux-${1}.tar.xz > /dev/null
24-
cd linux-${1}
25-
make allmodconfig
26-
27-
# Cannot use CONFIG_KCOV: -fsanitize-coverage=trace-pc is not supported by compiler
28-
sed -i 's/CONFIG_KCOV=y/CONFIG_KCOV=n/' .config
29-
30-
# stack validation depends on tools/objtool, but objtool does not compile on travis.
31-
# It is giving following error.
32-
# >>> GEN arch/x86/insn/inat-tables.c
33-
# >>> Semantic error at 40: Unknown imm opnd: AL
34-
# So for now disable stack-validation for the build.
35-
36-
sed -i 's/CONFIG_STACK_VALIDATION=y/CONFIG_STACK_VALIDATION=n/' .config
37-
make oldconfig
38-
39-
# Older kernels do not include openvswitch
40-
if [ -d "net/openvswitch" ]; then
41-
make net/openvswitch/
42-
else
43-
make net/bridge/
44-
fi
45-
46-
KERNELSRC=$(pwd)
47-
if [ ! "$DPDK" ] && [ ! "$DPDK_SHARED" ]; then
48-
EXTRA_OPTS="--with-linux=$(pwd)"
49-
fi
50-
echo "Installed kernel source in $(pwd)"
51-
cd ..
52-
}
53-
54-
function install_dpdk()
55-
{
56-
if [ -n "$DPDK_GIT" ]; then
57-
git clone $DPDK_GIT dpdk-$1
58-
cd dpdk-$1
59-
git checkout tags/v$1
60-
else
61-
wget https://fast.dpdk.org/rel/dpdk-$1.tar.xz
62-
tar xvf dpdk-$1.tar.xz > /dev/null
63-
DIR_NAME=$(tar -tf dpdk-$1.tar.xz | head -1 | cut -f1 -d"/")
64-
if [ $DIR_NAME != "dpdk-$1" ]; then mv $DIR_NAME dpdk-$1; fi
65-
cd dpdk-$1
66-
fi
67-
find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/'
68-
find ./ -type f | xargs sed -i 's/-Werror/-Werror -Wno-error=inline/'
69-
echo 'CONFIG_RTE_BUILD_FPIC=y' >>config/common_linuxapp
70-
sed -ri '/EXECENV_CFLAGS = -pthread -fPIC/{s/$/\nelse ifeq ($(CONFIG_RTE_BUILD_FPIC),y)/;s/$/\nEXECENV_CFLAGS = -pthread -fPIC/}' mk/exec-env/linuxapp/rte.vars.mk
71-
if [ "$DPDK_SHARED" ]; then
72-
sed -i '/CONFIG_RTE_BUILD_SHARED_LIB=n/s/=n/=y/' config/common_base
73-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$TARGET/lib
74-
fi
75-
make config CC=gcc T=$TARGET
76-
make -j4 CC=gcc RTE_KERNELDIR=$KERNELSRC
77-
echo "Installed DPDK source in $(pwd)"
78-
cd ..
79-
}
80-
8111
function configure_ovs()
8212
{
8313
./boot.sh && ./configure $* || { cat config.log; exit 1; }
8414
}
8515

86-
if [ "$KERNEL" ] || [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
87-
install_kernel $KERNEL
88-
fi
89-
90-
if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
91-
if [ -z "$DPDK_VER" ]; then
92-
DPDK_VER="18.11"
93-
fi
94-
install_dpdk $DPDK_VER
95-
if [ "$CC" = "clang" ]; then
96-
# Disregard cast alignment errors until DPDK is fixed
97-
CFLAGS="$CFLAGS -Wno-cast-align"
98-
fi
99-
EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/dpdk-$DPDK_VER/build"
100-
elif [ "$CC" != "clang" ]; then
101-
# DPDK headers currently trigger sparse errors
102-
SPARSE_FLAGS="$SPARSE_FLAGS -Wsparse-error"
103-
fi
104-
10516
OPTS="$EXTRA_OPTS $*"
10617

10718
if [ "$CC" = "clang" ]; then
@@ -116,11 +27,11 @@ fi
11627

11728
if [ "$TESTSUITE" ]; then
11829
# 'distcheck' will reconfigure with required options.
119-
# Now we only need to prepare the Makefile wihtout sparse-wrapped CC.
30+
# Now we only need to prepare the Makefile without sparse-wrapped CC.
12031
configure_ovs
12132

12233
export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
123-
if ! make distcheck TESTSUITEFLAGS=-j4 RECHECK=yes; then
34+
if ! make distcheck -j4 TESTSUITEFLAGS="-j4 -k ovn" RECHECK=yes; then
12435
# testsuite.log is necessary for debugging.
12536
cat */_build/tests/testsuite.log
12637
exit 1
@@ -129,10 +40,6 @@ else
12940
configure_ovs $OPTS
13041
make selinux-policy
13142

132-
# Only build datapath if we are testing kernel w/o running testsuite
133-
if [ "$KERNEL" ] && [ ! "$DPDK" ] && [ ! "$DPDK_SHARED" ]; then
134-
cd datapath
135-
fi
13643
make -j4
13744
fi
13845

0 commit comments

Comments
 (0)