mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-23 13:02:33 +00:00
This test check that the link is up, that we got a IP address and the output of the dhcpcd daemon. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
15 lines
301 B
Bash
Executable File
15 lines
301 B
Bash
Executable File
#!/bin/sh
|
|
|
|
function failed {
|
|
printf "dhcpcd test suite FAILED\n" >&1
|
|
exit 1
|
|
}
|
|
|
|
LINK=$(iplink | grep eth0 | grep UP)
|
|
ADDR=$(echo `ifconfig eth0 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'`)
|
|
|
|
[ -z "${LINK}" ] && failed
|
|
[ -z "${ADDR}" ] && failed
|
|
|
|
printf "dhcpcd test suite PASSED\n" >&1
|