]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
schema: require target path in storage pool xml
authorJán Tomko <jtomko@redhat.com>
Thu, 16 May 2013 13:37:14 +0000 (15:37 +0200)
committerJán Tomko <jtomko@redhat.com>
Fri, 17 May 2013 06:33:22 +0000 (08:33 +0200)
Make target path mandatory for pool types that require target,
since we refuse to parse a target without a path.

https://bugzilla.redhat.com/show_bug.cgi?id=893273

docs/schemas/storagepool.rng
tests/Makefile.am
tests/storagepoolschemadata/dir-missing-target-path-invalid.xml [new file with mode: 0644]
tests/storagepoolschematest

index eb56497ea235a9e3f135fb1e64ec654d8d413f09..3c2158a18f34aa5b00b05377afb25593dcb41b84 100644 (file)
 
   <define name='target'>
     <element name='target'>
-      <optional>
-        <element name='path'>
-          <ref name='absFilePath'/>
-        </element>
-      </optional>
+      <element name='path'>
+        <ref name='absFilePath'/>
+      </element>
       <ref name='permissions'/>
     </element>
   </define>
index 41c406741524a009b1a71ca9e033cc9813b75a97..04b76ba0d351b6926302faa6d9887adec4b272ae 100644 (file)
@@ -73,6 +73,7 @@ EXTRA_DIST =          \
        securityselinuxlabeldata \
        schematestutils.sh \
        sexpr2xmldata \
+       storagepoolschemadata \
        storagepoolschematest \
        storagepoolxml2xmlin \
        storagepoolxml2xmlout \
diff --git a/tests/storagepoolschemadata/dir-missing-target-path-invalid.xml b/tests/storagepoolschemadata/dir-missing-target-path-invalid.xml
new file mode 100644 (file)
index 0000000..8536781
--- /dev/null
@@ -0,0 +1,12 @@
+<pool type='dir'>
+  <name>test</name>
+  <source>
+  </source>
+  <target>
+    <permissions>
+      <mode>0700</mode>
+      <owner>-1</owner>
+      <group>-1</group>
+    </permissions>
+  </target>
+</pool>
index 9844c76771f996649ef00cb1cd4a211b54384134..d54b827c173dffb44e7310aee03beac3dc4addd9 100755 (executable)
@@ -4,7 +4,7 @@
 . $srcdir/test-lib.sh
 . $abs_srcdir/schematestutils.sh
 
-DIRS="storagepoolxml2xmlin storagepoolxml2xmlout"
+DIRS="storagepoolxml2xmlin storagepoolxml2xmlout storagepoolschemadata"
 SCHEMA="storagepool.rng"
 
 check_schema "$DIRS" "$SCHEMA"