diff --git a/tests/linux/dhcp_test b/tests/linux/dhcp_test index c451e74..57d988f 100755 --- a/tests/linux/dhcp_test +++ b/tests/linux/dhcp_test @@ -8,7 +8,8 @@ tests_init udhcpc_up \ dhcpcd_down \ dhclient_up \ udhcpc_opts_up \ - udhcpc_opts_up_subshell + udhcpc_opts_up_subshell \ + hostname_subshell udhcpc_up_body() { export IFACE=eth0 PHASE=up MOCK=echo IF_DHCP_PROGRAM=udhcpc @@ -45,3 +46,9 @@ udhcpc_opts_up_subshell_body() { atf_check -s exit:0 -o match:'/sbin/udhcpc -b -R -p /var/run/udhcpc.eth0.pid -i eth0 -O search -x hostname:test' \ ${EXECUTOR} } + +hostname_subshell_body() { + export IFACE=eth0 PHASE=up MOCK=echo IF_DHCP_PROGRAM=udhcpc IF_HOSTNAME="\$(echo test)" + atf_check -s exit:0 -o match:'/sbin/udhcpc -b -R -p /var/run/udhcpc.eth0.pid -i eth0 -x hostname:test' \ + ${EXECUTOR} +}