1 | image: fedora:latest
|
---|
2 |
|
---|
3 | variables:
|
---|
4 | DEPS: meson ninja-build
|
---|
5 | gcc libasan liblsan libubsan pkg-config glib2-devel
|
---|
6 | mingw64-gcc mingw64-pkg-config mingw64-glib2
|
---|
7 | clang-analyzer git-core
|
---|
8 |
|
---|
9 | before_script:
|
---|
10 | - dnf install -y $DEPS
|
---|
11 | - git fetch --tags https://gitlab.freedesktop.org/slirp/libslirp.git
|
---|
12 | - git describe
|
---|
13 |
|
---|
14 | build:
|
---|
15 | script:
|
---|
16 | - meson --werror build || (cat build/meson-logs/meson-log.txt && exit 1)
|
---|
17 | - ninja -C build
|
---|
18 | - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)
|
---|
19 | - ninja -C build scan-build
|
---|
20 |
|
---|
21 | build-asan:
|
---|
22 | script:
|
---|
23 | - CFLAGS=-fsanitize=address meson --werror build || (cat build/meson-logs/meson-log.txt && exit 1)
|
---|
24 | - ninja -C build
|
---|
25 | - (cd build && ASAN_OPTIONS=detect_leaks=0 meson test) || (cat build/meson-logs/testlog.txt && exit 1)
|
---|
26 |
|
---|
27 | build-lsan:
|
---|
28 | script:
|
---|
29 | - CFLAGS=-fsanitize=leak meson --werror build || (cat build/meson-logs/meson-log.txt && exit 1)
|
---|
30 | - ninja -C build
|
---|
31 | - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)
|
---|
32 |
|
---|
33 | build-usan:
|
---|
34 | script:
|
---|
35 | - CFLAGS=-fsanitize=undefined meson --werror build || (cat build/meson-logs/meson-log.txt && exit 1)
|
---|
36 | - ninja -C build
|
---|
37 | - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)
|
---|
38 |
|
---|
39 | build-mingw64:
|
---|
40 | script:
|
---|
41 | - (mkdir buildw && cd buildw && mingw64-meson --werror) || (cat buildw/meson-logs/meson-log.txt && exit 1)
|
---|
42 | - ninja -C buildw
|
---|
43 |
|
---|
44 | Coverity:
|
---|
45 | only:
|
---|
46 | refs:
|
---|
47 | - master
|
---|
48 | - coverity
|
---|
49 | script:
|
---|
50 | - dnf update -y
|
---|
51 | - dnf install -y curl clang
|
---|
52 | - curl -o /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64
|
---|
53 | --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN
|
---|
54 | - tar xfz /tmp/cov-analysis-linux64.tgz
|
---|
55 | - CC=clang meson build
|
---|
56 | - cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C build
|
---|
57 | - tar cfz cov-int.tar.gz cov-int
|
---|
58 | - curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
|
---|
59 | --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
|
---|
60 | --form [email protected] --form version="`git describe --tags`"
|
---|
61 | --form description="`git describe --tags` / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID "
|
---|
62 |
|
---|
63 | integration-slirp4netns:
|
---|
64 | variables:
|
---|
65 | SLIRP4NETNS_VERSION: "v1.1.12"
|
---|
66 | # Consumed by `make benchmark`
|
---|
67 | BENCHMARK_IPERF3_DURATION: "10"
|
---|
68 | script:
|
---|
69 | # Install libslirp
|
---|
70 | - meson build
|
---|
71 | - ninja -C build install
|
---|
72 | # Register the path of libslirp.so.0
|
---|
73 | - echo /usr/local/lib64 >/etc/ld.so.conf.d/libslirp.conf
|
---|
74 | - ldconfig
|
---|
75 | # Install the dependencies of slirp4netns and its test suite
|
---|
76 | # TODO: install udhcpc for `slirp4netns/tests/test-slirp4netns-dhcp.sh` (currently skipped, due to lack of udhcpc)
|
---|
77 | - dnf install -y autoconf automake findutils iperf3 iproute iputils jq libcap-devel libseccomp-devel nmap-ncat util-linux
|
---|
78 | # Check whether the runner environment is configured correctly
|
---|
79 | - unshare -rn true || (echo Make sure you have relaxed seccomp and appamor && exit 1)
|
---|
80 | - unshare -rn ip tap add tap0 mode tap || (echo Make sure you have /dev/net/tun && exit 1)
|
---|
81 | # Install slirp4netns
|
---|
82 | - git clone https://github.com/rootless-containers/slirp4netns -b "${SLIRP4NETNS_VERSION}"
|
---|
83 | - cd slirp4netns
|
---|
84 | - ./autogen.sh
|
---|
85 | - ./configure
|
---|
86 | - make
|
---|
87 | - make install
|
---|
88 | - slirp4netns --version
|
---|
89 | # Run slirp4netns integration test
|
---|
90 | - make distcheck || (cat $(find . -name 'test-suite.log' ) && exit 1)
|
---|
91 | # Run benchmark test to ensure that libslirp can actually handle packets, with several MTU configurations
|
---|
92 | - make benchmark MTU=1500
|
---|
93 | - make benchmark MTU=512
|
---|
94 | - make benchmark MTU=65520
|
---|