提交 8cf0ed02 编写于 作者: S Stefan Berger

nwfilter: Add filter schema for nwfilter XML, extend domain XML schema

This patch adds a relaxng nwfilter schema along with a test that
verifies all the test output XML against the schema. The input XMLs
contain a lot of intentional out-of-range values that make them fail the
schema verification, so I am not verifying against those.
上级 552bdb9b
......@@ -10,6 +10,7 @@ schema_DATA = \
storagepool.rng \
storagevol.rng \
nodedev.rng \
capability.rng
capability.rng \
nwfilter.rng
EXTRA_DIST = $(schema_DATA)
......@@ -894,6 +894,11 @@
<optional>
<ref name="address"/>
</optional>
<optional>
<element name="filterref">
<ref name="filterref-node-attributes"/>
</element>
</optional>
</interleave>
</define>
<!--
......@@ -1577,6 +1582,22 @@
</element>
</define>
<define name="filterref-node-attributes">
<attribute name="filter">
<data type="NCName"/>
</attribute>
<optional>
<element name="parameter">
<attribute name="name">
<ref name="filter-param-name"/>
</attribute>
<attribute name="value">
<ref name="filter-param-value"/>
</attribute>
</element>
</optional>
</define>
<!--
Type library
......@@ -1737,4 +1758,14 @@
<param name="pattern">[a-zA-Z0-9_\.\+\-/]+</param>
</data>
</define>
<define name="filter-param-name">
<data type="string">
<param name="pattern">[a-zA-Z0-9_]+</param>
</data>
</define>
<define name="filter-param-value">
<data type="string">
<param name="pattern">[a-zA-Z0-9_\.:]+</param>
</data>
</define>
</grammar>
此差异已折叠。
......@@ -785,6 +785,7 @@ fi
%{_datadir}/libvirt/schemas/interface.rng
%{_datadir}/libvirt/schemas/secret.rng
%{_datadir}/libvirt/schemas/storageencryption.rng
%{_datadir}/libvirt/schemas/nwfilter.rng
%{_datadir}/libvirt/cpu_map.xml
......
......@@ -74,6 +74,7 @@ EXTRA_DIST = \
xml2vmxdata \
nwfilterxml2xmlout \
nwfilterxml2xmlin \
nwfilterschematest \
$(patsubst %,qemuhelpdata/%,$(qemuhelpdata))
noinst_PROGRAMS = virshtest conftest \
......@@ -120,7 +121,8 @@ test_scripts = \
storagepoolschematest \
storagevolschematest \
domainschematest \
nodedevschematest
nodedevschematest \
nwfilterschematest
if WITH_LIBVIRTD
test_scripts += \
......
#!/bin/sh
: ${srcdir=.}
. $srcdir/test-lib.sh
. $abs_srcdir/schematestutils.sh
DIRS="nwfilterxml2xmlout"
SCHEMA="nwfilter.rng"
check_schema "$DIRS" "$SCHEMA"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册