tests: Add test for paranoid ovpn_copy_server_files
* Make sure this works * Related to #73
This commit is contained in:
parent
98340d7602
commit
7f58926aa2
22
tests/paranoid.sh
Executable file
22
tests/paranoid.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
IMG=${IMG:-kylemanna/openvpn}
|
||||||
|
|
||||||
|
temp=$(mktemp -d)
|
||||||
|
|
||||||
|
pushd $temp
|
||||||
|
|
||||||
|
SERV_IP=$(ip -4 -o addr show scope global | awk '{print $4}' | sed -e 's:/.*::' | head -n1)
|
||||||
|
|
||||||
|
docker run --net=none --rm -t -i -v $PWD:/etc/openvpn $IMG ovpn_genconfig -u udp://$SERV_IP
|
||||||
|
|
||||||
|
docker run --net=none --rm -t -i -v $PWD:/etc/openvpn -e "EASYRSA_BATCH=1" -e "EASYRSA_REQ_CN=Travis-CI Test CA" kylemanna/openvpn ovpn_initpki nopass
|
||||||
|
|
||||||
|
docker run --net=none --rm -t -i -v $PWD:/etc/openvpn $IMG ovpn_copy_server_files
|
||||||
|
|
||||||
|
popd
|
||||||
|
# Can't delete the temp directory as docker creates some files as root.
|
||||||
|
# Just let it die with the test instance.
|
||||||
|
rm -rf $temp || true
|
Loading…
Reference in New Issue
Block a user