From b4b0889c7a3f1b03661c4edc73fa71b9ba1b0e25 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 11 Sep 2020 02:43:32 -0600 Subject: [PATCH] tests: add test for hostname subshell --- tests/linux/dhcp_test | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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} +}