-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly support DHCP + add tests + update libslirp to v4.6.1
Close issue 124 The test should pass with libslirp < 4.6.0 and libslirp >= 4.6.1, but should fail with libslirp == 4.6.0 . https://gitlab.freedesktop.org/slirp/libslirp/-/issues/48 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
- Loading branch information
1 parent
0a9773c
commit d083361
Showing
11 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG LIBSLIRP_COMMIT=v4.6.0 | ||
ARG LIBSLIRP_COMMIT=v4.6.1 | ||
|
||
# Alpine | ||
FROM alpine:3 AS buildtest-alpine3-static | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
set -xeuo pipefail | ||
|
||
. $(dirname $0)/common.sh | ||
|
||
if ! command -v udhcpc 2>&1; then | ||
echo "udhcpc is missing, skipping the test" | ||
exit "$TEST_EXIT_CODE_SKIP" | ||
fi | ||
|
||
unshare -r -n sleep infinity & | ||
child=$! | ||
|
||
wait_for_network_namespace $child | ||
|
||
slirp4netns $child tap0 & | ||
slirp_pid=$! | ||
|
||
udhcpc_log=$(mktemp /tmp/slirp4netns-test-udhcpc.XXXXXXXXXX) | ||
|
||
function cleanup { | ||
kill -9 $child $slirp_pid | ||
rm -f $udhcpc_log | ||
} | ||
trap cleanup EXIT | ||
|
||
nsenter $(nsenter_flags $child) ip link set lo up | ||
nsenter $(nsenter_flags $child) ip link set tap0 up | ||
nsenter $(nsenter_flags $child) timeout 10s udhcpc -q -i tap0 -s /bin/true 2>&1 | tee $udhcpc_log | ||
grep 10.0.2.15 $udhcpc_log |