tests: Add storagepool xml test for netfs-auto

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>
This commit is contained in:
John Ferlan 2018-12-04 10:20:59 -05:00
parent f2f84b4d4a
commit 515aa0c184
5 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1 @@
mount localhost:/var/lib/libvirt/images /mnt

View File

@ -146,6 +146,7 @@ mymain(void)
DO_TEST_FAIL("pool-iscsi"); DO_TEST_FAIL("pool-iscsi");
DO_TEST_FAIL("pool-iscsi-auth"); DO_TEST_FAIL("pool-iscsi-auth");
DO_TEST("pool-netfs"); DO_TEST("pool-netfs");
DO_TEST("pool-netfs-auto");
DO_TEST("pool-netfs-gluster"); DO_TEST("pool-netfs-gluster");
DO_TEST("pool-netfs-cifs"); DO_TEST("pool-netfs-cifs");
DO_TEST_FAIL("pool-scsi"); DO_TEST_FAIL("pool-scsi");

View File

@ -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>

View File

@ -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>

View File

@ -82,6 +82,7 @@ mymain(void)
DO_TEST("pool-iscsi"); DO_TEST("pool-iscsi");
DO_TEST("pool-iscsi-auth"); DO_TEST("pool-iscsi-auth");
DO_TEST("pool-netfs"); DO_TEST("pool-netfs");
DO_TEST("pool-netfs-auto");
DO_TEST("pool-netfs-gluster"); DO_TEST("pool-netfs-gluster");
DO_TEST("pool-netfs-cifs"); DO_TEST("pool-netfs-cifs");
DO_TEST("pool-scsi"); DO_TEST("pool-scsi");