]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Fix the schema and add tests for cifs pool
authorJohn Ferlan <jferlan@redhat.com>
Wed, 3 Jun 2015 15:43:00 +0000 (11:43 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 15 Jun 2015 21:25:33 +0000 (17:25 -0400)
Commit id '887dd362' added support for a netfs pool format type 'cifs'
and 'gluster' in order to add rng support for Samba and glusterfs netfs
pools. Originally, the CIFS type support was added as part of commit
id '61fb6979'. Eventually commit id 'b325be12' fixed the gluster rng
definition to match expectations.

As it turns out the CIFS rng needed a similar change since the directory
path is not an absDirPath, rather just a dirPath will be required.

docs/schemas/storagepool.rng
tests/storagepoolxml2xmlin/pool-netfs-cifs.xml [new file with mode: 0644]
tests/storagepoolxml2xmlout/pool-netfs-cifs.xml [new file with mode: 0644]
tests/storagepoolxml2xmltest.c

index db6ff49a0425e7b1ee17865ce1573003370f73f2..9c528175bd3b8b8cdf6bc7bb8657ca4dd7c49ecf 100644 (file)
     </element>
   </define>
 
-  <define name='sourceinfonetfsgluster'>
+  <define name='sourceinfonetrelativepath'>
     <element name='dir'>
       <attribute name='path'>
         <ref name='dirPath'/>
           <choice>
             <value>auto</value>
             <value>nfs</value>
-            <value>cifs</value>
           </choice>
         </attribute>
       </element>
         <group>
           <interleave>
             <ref name='sourceinfohost'/>
-            <ref name='sourceinfonetfsgluster'/>
+            <ref name='sourceinfonetrelativepath'/>
             <element name='format'>
               <attribute name='type'>
-                <value>glusterfs</value>
+                <choice>
+                  <value>cifs</value>
+                  <value>glusterfs</value>
+                </choice>
               </attribute>
             </element>
             <optional>
diff --git a/tests/storagepoolxml2xmlin/pool-netfs-cifs.xml b/tests/storagepoolxml2xmlin/pool-netfs-cifs.xml
new file mode 100644 (file)
index 0000000..0bc6380
--- /dev/null
@@ -0,0 +1,12 @@
+<pool type='netfs'>
+  <source>
+    <host name='example.com'/>
+    <format type='cifs'/>
+    <dir path='samba_share'/>
+  </source>
+  <name>netfs-cifs</name>
+  <uuid>d5609ced-94b1-489e-b218-eff35c30336a</uuid>
+  <target>
+    <path>/mnt/cifs</path>
+  </target>
+</pool>
diff --git a/tests/storagepoolxml2xmlout/pool-netfs-cifs.xml b/tests/storagepoolxml2xmlout/pool-netfs-cifs.xml
new file mode 100644 (file)
index 0000000..afaa7d0
--- /dev/null
@@ -0,0 +1,15 @@
+<pool type='netfs'>
+  <name>netfs-cifs</name>
+  <uuid>d5609ced-94b1-489e-b218-eff35c30336a</uuid>
+  <capacity unit='bytes'>0</capacity>
+  <allocation unit='bytes'>0</allocation>
+  <available unit='bytes'>0</available>
+  <source>
+    <host name='example.com'/>
+    <dir path='samba_share'/>
+    <format type='cifs'/>
+  </source>
+  <target>
+    <path>/mnt/cifs</path>
+  </target>
+</pool>
index bec1b8fa1d0b85a7dc6baf6b96e328cd9e08428f..b03c4b01766f32d7c24edc961a2a4a3dbeea5b0b 100644 (file)
@@ -84,6 +84,7 @@ mymain(void)
     DO_TEST("pool-iscsi-auth");
     DO_TEST("pool-netfs");
     DO_TEST("pool-netfs-gluster");
+    DO_TEST("pool-netfs-cifs");
     DO_TEST("pool-scsi");
     DO_TEST("pool-scsi-type-scsi-host");
     DO_TEST("pool-scsi-type-fc-host");