aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Novotny <minovotn@redhat.com>2012-01-02 15:23:54 +0100
committerDaniel Veillard <veillard@redhat.com>2012-01-02 23:05:55 +0800
commit973af2362cbf5348134b7ee90dbd34481182b9ac (patch)
tree29a7d35f79cc6495ab8c69432bc41825a7497f09 /tests/networkxml2argvdata
parentqemu: Fix bandwidth memory leak on failure (diff)
downloadlibvirt-973af2362cbf5348134b7ee90dbd34481182b9ac.tar.gz
libvirt-973af2362cbf5348134b7ee90dbd34481182b9ac.tar.bz2
libvirt-973af2362cbf5348134b7ee90dbd34481182b9ac.zip
Implement DNS SRV record into the bridge driver
Hi, this is the fifth version of my SRV record for DNSMasq patch rebased for the current codebase to the bridge driver and libvirt XML file to include support for the SRV records in the DNS. The syntax is based on DNSMasq man page and tests for both xml2xml and xml2argv were added as well. There are some things written a better way in comparison with version 4, mainly there's no hack in tests/networkxml2argvtest.c and also the xPath context is changed to use a simpler query using the virXPathInt() function relative to the current node. Also, the patch is also fixing the networkxml2argv test to pass both checks, i.e. both unit tests and also syntax check. Please review, Michal Signed-off-by: Michal Novotny <minovotn@redhat.com>
Diffstat (limited to 'tests/networkxml2argvdata')
-rw-r--r--tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv16
-rw-r--r--tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.xml26
-rw-r--r--tests/networkxml2argvdata/nat-network-dns-srv-record.argv16
-rw-r--r--tests/networkxml2argvdata/nat-network-dns-srv-record.xml26
4 files changed, 84 insertions, 0 deletions
diff --git a/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv b/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
new file mode 100644
index 000000000..021e8f07a
--- /dev/null
+++ b/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
@@ -0,0 +1,16 @@
+/usr/sbin/dnsmasq \
+--strict-order \
+--bind-interfaces \
+--conf-file= \
+--except-interface lo \
+--srv-host=name.tcp.,,,, \
+--listen-address 192.168.122.1 \
+--listen-address 192.168.123.1 \
+--listen-address 2001:db8:ac10:fe01::1 \
+--listen-address 2001:db8:ac10:fd01::1 \
+--listen-address 10.24.10.1 \
+--dhcp-range 192.168.122.2,192.168.122.254 \
+--dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases \
+--dhcp-lease-max=253 \
+--dhcp-no-override \
+--dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile\
diff --git a/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.xml
new file mode 100644
index 000000000..e9b768060
--- /dev/null
+++ b/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.xml
@@ -0,0 +1,26 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <forward dev='eth1' mode='nat'>
+ <interface dev='eth1'/>
+ </forward>
+ <bridge name='virbr0' stp='on' delay='0' />
+ <dns>
+ <srv service='name' protocol='tcp' />
+ </dns>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <range start='192.168.122.2' end='192.168.122.254' />
+ <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10' />
+ <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11' />
+ </dhcp>
+ </ip>
+ <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'>
+ </ip>
+ <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'>
+ </ip>
+ <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'>
+ </ip>
+ <ip family='ipv4' address='10.24.10.1'>
+ </ip>
+</network>
diff --git a/tests/networkxml2argvdata/nat-network-dns-srv-record.argv b/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
new file mode 100644
index 000000000..85afbba70
--- /dev/null
+++ b/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
@@ -0,0 +1,16 @@
+/usr/sbin/dnsmasq \
+--strict-order \
+--bind-interfaces \
+--conf-file= \
+--except-interface lo \
+--srv-host=name.tcp.test-domain-name,.,1024,10,10 \
+--listen-address 192.168.122.1 \
+--listen-address 192.168.123.1 \
+--listen-address 2001:db8:ac10:fe01::1 \
+--listen-address 2001:db8:ac10:fd01::1 \
+--listen-address 10.24.10.1 \
+--dhcp-range 192.168.122.2,192.168.122.254 \
+--dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases \
+--dhcp-lease-max=253 \
+--dhcp-no-override \
+--dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile\
diff --git a/tests/networkxml2argvdata/nat-network-dns-srv-record.xml b/tests/networkxml2argvdata/nat-network-dns-srv-record.xml
new file mode 100644
index 000000000..4be85b50a
--- /dev/null
+++ b/tests/networkxml2argvdata/nat-network-dns-srv-record.xml
@@ -0,0 +1,26 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <forward dev='eth1' mode='nat'>
+ <interface dev='eth1'/>
+ </forward>
+ <bridge name='virbr0' stp='on' delay='0' />
+ <dns>
+ <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10' />
+ </dns>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <range start='192.168.122.2' end='192.168.122.254' />
+ <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10' />
+ <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11' />
+ </dhcp>
+ </ip>
+ <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'>
+ </ip>
+ <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'>
+ </ip>
+ <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'>
+ </ip>
+ <ip family='ipv4' address='10.24.10.1'>
+ </ip>
+</network>