[v3,4/6] net/dhcp: Check also default dhclient lease file path

Message ID 20181218010220.2446-5-pvorel@suse.cz
State Accepted
Headers show
Series
  • DHCP tests and AppArmor/SELinux improvements
Related show

Commit Message

Petr Vorel Dec. 18, 2018, 1:02 a.m.
/var/lib/dhclient/dhclient{6,}.leases is used on
Fedora/RHEL/CentOS/Oracle Linux (since dhcp 4.0 in 2008)
Check also default upstream path for dhclient on Linux.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/dhcp/dhcp_lib.sh | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/testcases/network/dhcp/dhcp_lib.sh b/testcases/network/dhcp/dhcp_lib.sh
index b8611f49d..632b1a9b1 100755
--- a/testcases/network/dhcp/dhcp_lib.sh
+++ b/testcases/network/dhcp/dhcp_lib.sh
@@ -59,6 +59,7 @@  dhcp_lib_setup()
 	stop_dhcp || tst_brk TBROK "Failed to stop dhcp server"
 
 	dhclient_lease="/var/lib/dhclient/dhclient${TST_IPV6}.leases"
+	[ -f $dhclient_lease ] || dhclient_lease="/var/lib/dhcp/dhclient${TST_IPV6}.leases"
 	if [ -f $dhclient_lease ]; then
 		tst_res TINFO "backup dhclient${TST_IPV6}.leases"
 		mv $dhclient_lease .