Skip to content

Commit ce99758

Browse files
committed
Introduce e2e test between vpnkit and tap-vsockd
Signed-off-by: Simon Ferquel <[email protected]>
1 parent 692964c commit ce99758

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ before_install: # update to 17.05 to get multistage builds
1212
- sudo apt-get -y install docker-ce
1313

1414
script:
15+
- make e2e-vpnkit-tap-vsockd
1516
- cd go && make build-in-container

Makefile

+14-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ COMMIT:
8282
@mv $@.tmp $@
8383

8484
.PHONY: clean
85-
clean:
85+
clean:
8686
rm -rf _build
8787
rm -f vpnkit.exe
8888
rm -f vpnkit.tgz
@@ -99,3 +99,16 @@ pkg-%:
9999
PKGS=$(basename $(wildcard *.opam))
100100
opam-pkg:
101101
$(MAKE) $(PKGS:%=pkg-%)
102+
103+
e2e-vpnkit-tap-vsockd:
104+
docker build -t vpnkit-host .
105+
docker build -t vpnkit-guest c/vpnkit-tap-vsockd
106+
docker rm -f vpnkit-test-host vpnkit-test-guest || echo "no garbage container"
107+
docker volume rm -f vpnkit-test
108+
docker volume create vpnkit-test
109+
docker run -d --name vpnkit-test-host -v vpnkit-test:/shared vpnkit-host /vpnkit --ethernet /shared/vpnkit.sock
110+
docker run -d --name vpnkit-test-guest --network=none --cap-add NET_ADMIN -v vpnkit-test:/shared vpnkit-guest \
111+
sh -c "mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && /sbin/vpnkit-tap-vsockd --tap eth0 --path /shared/vpnkit.sock"
112+
docker exec vpnkit-test-guest sh -c "dhclient eth0 && wget http://www.google.com"
113+
docker rm -f vpnkit-test-host vpnkit-test-guest
114+
docker volume rm -f vpnkit-test

c/vpnkit-tap-vsockd/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ RUN make -C /build sbin/vpnkit-tap-vsockd
66

77
# Using alpine rather than scratch allows us to support post-up scripts
88
FROM alpine:3.8
9-
9+
RUN apk add dhclient
1010
COPY --from=build /build/sbin/vpnkit-tap-vsockd /sbin/vpnkit-tap-vsockd
1111
CMD [ "/sbin/vpnkit-tap-vsockd", "--tap", "eth0", "--message-size", "8192", "--buffer-size", "262144", "--path", "/run/host-services/vpnkit.sock" ]

0 commit comments

Comments
 (0)