Skip to content

Commit

Permalink
dnsmasq: Final fix of library inclusion
Browse files Browse the repository at this point in the history
We need to set $dhcp_name *before* loading library (. dhcp_lib.sh)
due possible TCONF due missing dnsmasq. But $lease_dir must be set
*after* loading library due tst_selinux_enforced. Because $lease_file
depends on $lease_dir, move all but $dhcp_name variable behind
loading dhcp_lib.sh.

Fixes: a49a7e9 ("dnsmasq: Proper fix of library inclusion")
Fixes: 1cb8e31 ("dnsmasq: Fix variable initialization")
Fixes: 0402163 ("tst_test.sh: Cleanup getopts usage")
Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
pevik committed Apr 11, 2024
1 parent 8f3b7bb commit b592cdd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions testcases/network/dhcp/dnsmasq_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ print_dhcp_version()
dnsmasq --version | head -2
}

dhcp_name="dnsmasq"
. dhcp_lib.sh

lease_dir="/var/lib/misc"
tst_selinux_enforced && lease_dir="/var/lib/dnsmasq"

dhcp_name="dnsmasq"
log="/var/log/dnsmasq.tst.log"

lease_file="$lease_dir/dnsmasq.tst.leases"
Expand All @@ -44,6 +47,4 @@ common_opt="--no-hosts --no-resolv --dhcp-authoritative \
--log-facility=$log --interface=$iface0 \
--dhcp-leasefile=$lease_file --port=0 --conf-file= "

. dhcp_lib.sh
tst_selinux_enforced && lease_dir="/var/lib/dnsmasq"
tst_run

0 comments on commit b592cdd

Please sign in to comment.