tests: add test for hostname subshell

This commit is contained in:
Ariadne Conill 2020-09-11 02:43:32 -06:00
parent 5d4e3699b2
commit b4b0889c7a

View file

@ -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}
}