]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Add storagepool xml test for netfs-auto
authorJohn Ferlan <jferlan@redhat.com>
Tue, 4 Dec 2018 15:20:59 +0000 (10:20 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 13 Dec 2018 12:09:42 +0000 (07:09 -0500)
Cover the case where @netauto would be used to create the command
line in virStorageBackendFileSystemMountCmd. Essentially when the
pool type is "netfs", but the "source.format" is empty, create the
command line properly.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
tests/storagepoolxml2argvdata/pool-netfs-auto.argv [new file with mode: 0644]
tests/storagepoolxml2argvtest.c
tests/storagepoolxml2xmlin/pool-netfs-auto.xml [new file with mode: 0644]
tests/storagepoolxml2xmlout/pool-netfs-auto.xml [new file with mode: 0644]
tests/storagepoolxml2xmltest.c

diff --git a/tests/storagepoolxml2argvdata/pool-netfs-auto.argv b/tests/storagepoolxml2argvdata/pool-netfs-auto.argv
new file mode 100644 (file)
index 0000000..888a016
--- /dev/null
@@ -0,0 +1 @@
+mount localhost:/var/lib/libvirt/images /mnt
index 128fab2de66fe552397851becc8bb6bf65b966f0..bb9e8805543102ce84922dae9d326634b0557e40 100644 (file)
@@ -146,6 +146,7 @@ mymain(void)
     DO_TEST_FAIL("pool-iscsi");
     DO_TEST_FAIL("pool-iscsi-auth");
     DO_TEST("pool-netfs");
+    DO_TEST("pool-netfs-auto");
     DO_TEST("pool-netfs-gluster");
     DO_TEST("pool-netfs-cifs");
     DO_TEST_FAIL("pool-scsi");
diff --git a/tests/storagepoolxml2xmlin/pool-netfs-auto.xml b/tests/storagepoolxml2xmlin/pool-netfs-auto.xml
new file mode 100644 (file)
index 0000000..d7f7ce8
--- /dev/null
@@ -0,0 +1,19 @@
+<pool type='netfs'>
+  <name>nfsimages</name>
+  <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
+  <capacity>0</capacity>
+  <allocation>0</allocation>
+  <available>0</available>
+  <source>
+    <host name='localhost'/>
+    <dir path='/var/lib/libvirt/images'/>
+  </source>
+  <target>
+    <path>/mnt</path>
+    <permissions>
+      <mode>0700</mode>
+      <owner>0</owner>
+      <group>0</group>
+    </permissions>
+  </target>
+</pool>
diff --git a/tests/storagepoolxml2xmlout/pool-netfs-auto.xml b/tests/storagepoolxml2xmlout/pool-netfs-auto.xml
new file mode 100644 (file)
index 0000000..a180ca5
--- /dev/null
@@ -0,0 +1,20 @@
+<pool type='netfs'>
+  <name>nfsimages</name>
+  <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
+  <capacity unit='bytes'>0</capacity>
+  <allocation unit='bytes'>0</allocation>
+  <available unit='bytes'>0</available>
+  <source>
+    <host name='localhost'/>
+    <dir path='/var/lib/libvirt/images'/>
+    <format type='auto'/>
+  </source>
+  <target>
+    <path>/mnt</path>
+    <permissions>
+      <mode>0700</mode>
+      <owner>0</owner>
+      <group>0</group>
+    </permissions>
+  </target>
+</pool>
index 8230dc8ddca8c5eb8374b47da83e49ead5b4c485..707d09f5c28070fcbecae2c5951e9add5cfede12 100644 (file)
@@ -82,6 +82,7 @@ mymain(void)
     DO_TEST("pool-iscsi");
     DO_TEST("pool-iscsi-auth");
     DO_TEST("pool-netfs");
+    DO_TEST("pool-netfs-auto");
     DO_TEST("pool-netfs-gluster");
     DO_TEST("pool-netfs-cifs");
     DO_TEST("pool-scsi");