File tree 5 files changed +79
-1
lines changed
5 files changed +79
-1
lines changed Original file line number Diff line number Diff line change 1
1
/target /
2
2
/build /
3
3
/dist
4
+ /test /dist
4
5
.idea /
5
6
.DS_Store
6
7
* .log
Original file line number Diff line number Diff line change 1
1
ARG IMAGE=ghcr.io/mullvad/mullvadvpn-app-build:latest
2
2
FROM $IMAGE
3
3
4
+ ENV OPENSSL_STATIC=1 \
5
+ OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu \
6
+ OPENSSL_INCLUDE_DIR=/usr/include/openssl \
7
+ TEST_MANAGER_STATIC=1
8
+
4
9
RUN rustup target add x86_64-pc-windows-gnu
5
10
6
11
RUN apt-get update && apt-get install -y \
7
- mtools pkg-config libssl-dev libpcap-dev
12
+ mtools pkg-config libssl-dev
13
+
14
+ RUN git clone https://github.com/the-tcpdump-group/libpcap.git
15
+ RUN apt-get install -y autoconf flex bison
16
+
17
+ RUN cd libpcap \
18
+ && ./autogen.sh \
19
+ && ./configure --enable-remote=yes --enable-dbus=no --enable-shared=no \
20
+ && make \
21
+ && make install
22
+
23
+ RUN rm -rf libpcap
24
+ RUN apt-get remove -y autoconf flex bison
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -eu
4
+
5
+ # Build `test-manager`
6
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
7
+ TEST_FRAMEWORK_ROOT=" $SCRIPT_DIR /.."
8
+ REPO_DIR=" $TEST_FRAMEWORK_ROOT /.."
9
+
10
+ # shellcheck disable=SC1091
11
+ source " $REPO_DIR /scripts/utils/log"
12
+
13
+ build_linux () {
14
+ cd " $TEST_FRAMEWORK_ROOT "
15
+ # Build the test manager
16
+ cargo build -p test-manager --release
17
+ }
18
+
19
+ case ${1-: " " } in
20
+ linux)
21
+ build_linux
22
+ shift
23
+ ;;
24
+ * )
25
+ log_error " Invalid platform. Specify a valid platform as first argument"
26
+ exit 1
27
+ esac
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -eu
4
+
5
+ # Build distributable binaries for the test framework.
6
+ # TODO: Support macOS
7
+
8
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
9
+ TEST_FRAMEWORK_ROOT=" $SCRIPT_DIR /.."
10
+
11
+ # Build
12
+ build_linux () {
13
+ mkdir -p " $TEST_FRAMEWORK_ROOT /dist"
14
+ # Build the test manager
15
+ " $SCRIPT_DIR /build-manager.sh" linux
16
+ cp " $TEST_FRAMEWORK_ROOT /target/release/test-manager" " $TEST_FRAMEWORK_ROOT /dist/"
17
+
18
+ # Build the test runner
19
+ " $SCRIPT_DIR /build-runner.sh" linux
20
+ cp " $TEST_FRAMEWORK_ROOT /target/x86_64-unknown-linux-gnu/release/test-runner" " $TEST_FRAMEWORK_ROOT /dist/"
21
+ cp " $TEST_FRAMEWORK_ROOT /target/x86_64-unknown-linux-gnu/release/connection-checker" " $TEST_FRAMEWORK_ROOT /dist/"
22
+ }
23
+
24
+ build_linux
Original file line number Diff line number Diff line change
1
+ use std:: env:: var;
2
+
1
3
fn main ( ) {
2
4
// Rebuild if SSH provision script changes
3
5
println ! ( "cargo::rerun-if-changed=../scripts/ssh-setup.sh" ) ;
6
+
7
+ let link_statically = var ( "TEST_MANAGER_STATIC" ) . is_ok_and ( |x| x != "0" ) ;
8
+
9
+ if link_statically {
10
+ println ! ( "cargo::rustc-link-search=native=/usr/lib/x86_64-linux-gnu" ) ;
11
+ println ! ( "cargo::rustc-link-lib=static=pcap" ) ;
12
+ }
4
13
}
You can’t perform that action at this time.
0 commit comments