Files
Rolf Neugebauer f434615f91 tests: Add a test for the dhcpcd package
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>
2017-05-29 11:42:07 +01:00

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