• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# Copyright (c) 2014-2015 Oracle and/or its affiliates. All Rights Reserved.
3#
4# This program is free software; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License as
6# published by the Free Software Foundation; either version 2 of
7# the License, or (at your option) any later version.
8#
9# This program is distributed in the hope that it would be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write the Free Software Foundation,
16# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17#
18# Author: Alexey Kodanev alexey.kodanev@oracle.com
19
20TST_CLEANUP=cleanup
21TST_TOTAL=1
22TCID="dnsmasq"
23dhcp_name="dnsmasq"
24
25. test_net.sh
26. dhcp_lib.sh
27
28start_dhcp()
29{
30	dnsmasq $common_opt \
31	        --dhcp-range=10.1.1.100,10.1.1.100,255.255.255.0,2m \
32	        --dhcp-option=option:router --dhcp-option=option:dns-server
33}
34
35start_dhcp6()
36{
37	# check that dnsmasq supports IPv6
38	dnsmasq --dhcp-range=fd00::1,fd00::1 --test > /dev/null 2>&1 || \
39		tst_brkm TCONF "dnsmasq doesn't support DHCPv6"
40
41	dnsmasq $common_opt \
42	        --dhcp-range=fd00:1:1:2::100,fd00:1:1:2::100 --enable-ra \
43	        --dhcp-option=option6:dns-server
44}
45
46cleanup_dhcp()
47{
48	rm -f tst_dnsmasq.log
49}
50
51print_dhcp_log()
52{
53	cat tst_dnsmasq.log
54}
55
56init
57
58common_opt="--no-hosts --no-resolv --dhcp-authoritative \
59	--log-facility=$(pwd)/tst_dnsmasq.log --interface=$iface0 \
60	--dhcp-leasefile=$(pwd)/tst_dnsmasq.lease --conf-file= "
61
62test01
63tst_exit
64