make the <dhcp> element optional in network.rng

In practice this has always been optional, but the RNG has shown it as
mandatory, and since all the examples for make check had it, it was
never noticed. One of the existing test cases has been changed to
check for this.

I also noticed that the dhcp/host/ip was still defined as <text/>,
but should really be <ref name='ipv4-addr'/>
This commit is contained in:
Laine Stump 2010-12-16 12:36:19 -05:00
parent 20718b8bcb
commit 008abeeeb9
3 changed files with 27 additions and 31 deletions

View File

@ -95,31 +95,33 @@
<attribute name="root"><text/></attribute> <attribute name="root"><text/></attribute>
</element> </element>
</optional> </optional>
<!-- Define the range(s) of IP addresses that the DHCP <optional>
server should hand out --> <!-- Define the range(s) of IP addresses that the DHCP
<element name="dhcp"> server should hand out -->
<zeroOrMore> <element name="dhcp">
<element name="range"> <zeroOrMore>
<attribute name="start"><ref name="ipv4-addr"/></attribute> <element name="range">
<attribute name="end"><ref name="ipv4-addr"/></attribute> <attribute name="start"><ref name="ipv4-addr"/></attribute>
</element> <attribute name="end"><ref name="ipv4-addr"/></attribute>
</zeroOrMore> </element>
<zeroOrMore> </zeroOrMore>
<element name="host"> <zeroOrMore>
<attribute name="mac"><ref name="mac-addr"/></attribute> <element name="host">
<attribute name="name"><text/></attribute> <attribute name="mac"><ref name="mac-addr"/></attribute>
<attribute name="ip"><text/></attribute> <attribute name="name"><text/></attribute>
</element> <attribute name="ip"><ref name="ipv4-addr"/></attribute>
</zeroOrMore> </element>
<optional> </zeroOrMore>
<element name="bootp"> <optional>
<attribute name="file"><text/></attribute> <element name="bootp">
<optional> <attribute name="file"><text/></attribute>
<attribute name="server"><text/></attribute> <optional>
</optional> <attribute name="server"><text/></attribute>
</element> </optional>
</optional> </element>
</element> </optional>
</element>
</optional>
</element> </element>
</optional> </optional>
</interleave> </interleave>

View File

@ -4,8 +4,5 @@
<bridge name="virbr1" /> <bridge name="virbr1" />
<forward mode="route" dev="eth1"/> <forward mode="route" dev="eth1"/>
<ip address="192.168.122.1" netmask="255.255.255.0"> <ip address="192.168.122.1" netmask="255.255.255.0">
<dhcp>
<range start="192.168.122.2" end="192.168.122.254" />
</dhcp>
</ip> </ip>
</network> </network>

View File

@ -4,8 +4,5 @@
<forward dev='eth1' mode='route'/> <forward dev='eth1' mode='route'/>
<bridge name='virbr1' stp='on' delay='0' /> <bridge name='virbr1' stp='on' delay='0' />
<ip address='192.168.122.1' netmask='255.255.255.0'> <ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254' />
</dhcp>
</ip> </ip>
</network> </network>