File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ imageTests+=(
9
9
[openvpn]='
10
10
paranoid
11
11
conf_options
12
+ client
12
13
basic
13
14
dual-proto
14
15
otp
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Function to fail
4
+ abort () { cat <<< " $@" 1>&2 ; exit 1; }
5
+
6
+
7
+ #
8
+ # Generate openvpn.config file
9
+ #
10
+ SERV_IP=$( ip -4 -o addr show scope global | awk ' {print $4}' | sed -e ' s:/.*::' | head -n1)
11
+
12
+ ovpn_genconfig \
13
+ -u udp://$SERV_IP \
14
+ -m 1337 \
15
+
16
+
17
+ EASYRSA_BATCH=1 EASYRSA_REQ_CN=" Travis-CI Test CA" ovpn_initpki nopass
18
+
19
+ easyrsa build-client-full test1 nopass 2> /dev/null
20
+
21
+ TEST1_OVPN=" /etc/openvpn/test1.ovpn"
22
+ ovpn_getclient test1 > " ${TEST1_OVPN} "
23
+
24
+ # Check a config (haystack) for a given line (needle) exit with error if not found.
25
+ test-client-config () {
26
+
27
+ local needle=" ${1} "
28
+
29
+ busybox grep -q " ${needle} " " ${TEST1_OVPN} "
30
+ if [ $? -ne 0 ]; then
31
+ abort " ==> Config match not found: ${needle} "
32
+ fi
33
+ }
34
+
35
+ #
36
+ # Test cases
37
+ #
38
+
39
+ # Test 1: Check MTU
40
+ test-client-config " ^tun-mtu\s+1337"
Original file line number Diff line number Diff line change
1
+ ../run-bash-in-container.sh
You can’t perform that action at this time.
0 commit comments