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>
</element>
</optional>
<!-- Define the range(s) of IP addresses that the DHCP
server should hand out -->
<element name="dhcp">
<zeroOrMore>
<element name="range">
<attribute name="start"><ref name="ipv4-addr"/></attribute>
<attribute name="end"><ref name="ipv4-addr"/></attribute>
</element>
</zeroOrMore>
<zeroOrMore>
<element name="host">
<attribute name="mac"><ref name="mac-addr"/></attribute>
<attribute name="name"><text/></attribute>
<attribute name="ip"><text/></attribute>
</element>
</zeroOrMore>
<optional>
<element name="bootp">
<attribute name="file"><text/></attribute>
<optional>
<attribute name="server"><text/></attribute>
</optional>
</element>
</optional>
</element>
<optional>
<!-- Define the range(s) of IP addresses that the DHCP
server should hand out -->
<element name="dhcp">
<zeroOrMore>
<element name="range">
<attribute name="start"><ref name="ipv4-addr"/></attribute>
<attribute name="end"><ref name="ipv4-addr"/></attribute>
</element>
</zeroOrMore>
<zeroOrMore>
<element name="host">
<attribute name="mac"><ref name="mac-addr"/></attribute>
<attribute name="name"><text/></attribute>
<attribute name="ip"><ref name="ipv4-addr"/></attribute>
</element>
</zeroOrMore>
<optional>
<element name="bootp">
<attribute name="file"><text/></attribute>
<optional>
<attribute name="server"><text/></attribute>
</optional>
</element>
</optional>
</element>
</optional>
</element>
</optional>
</interleave>

View File

@ -4,8 +4,5 @@
<bridge name="virbr1" />
<forward mode="route" dev="eth1"/>
<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>
</network>

View File

@ -4,8 +4,5 @@
<forward dev='eth1' mode='route'/>
<bridge name='virbr1' stp='on' delay='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>
</network>