mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
storage: Add tests for logical backend startup
Add the logical storage pool startup validation (xml2argv) tests. Signed-off-by: John Ferlan <jferlan@redhat.com> ACKed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
df1a9c7380
commit
a15fe1247d
@ -52,11 +52,7 @@ virStorageBackendLogicalSetActive(virStoragePoolObjPtr pool,
|
||||
{
|
||||
int ret;
|
||||
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
|
||||
virCommandPtr cmd =
|
||||
virCommandNewArgList(VGCHANGE,
|
||||
on ? "-aly" : "-aln",
|
||||
def->source.name,
|
||||
NULL);
|
||||
virCommandPtr cmd = virStorageBackendLogicalChangeCmd(def, on);
|
||||
|
||||
ret = virCommandRun(cmd, NULL);
|
||||
virCommandFree(cmd);
|
||||
|
@ -4337,3 +4337,14 @@ virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
|
||||
virStorageBackendFileSystemMountDefaultArgs(cmd, src, def);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
virCommandPtr
|
||||
virStorageBackendLogicalChangeCmd(virStoragePoolDefPtr def,
|
||||
bool on)
|
||||
{
|
||||
return virCommandNewArgList(VGCHANGE,
|
||||
on ? "-aly" : "-aln",
|
||||
def->source.name,
|
||||
NULL);
|
||||
}
|
||||
|
@ -184,4 +184,8 @@ virCommandPtr
|
||||
virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
|
||||
const char *src);
|
||||
|
||||
virCommandPtr
|
||||
virStorageBackendLogicalChangeCmd(virStoragePoolDefPtr def,
|
||||
bool on);
|
||||
|
||||
#endif /* __VIR_STORAGE_UTIL_H__ */
|
||||
|
1
tests/storagepoolxml2argvdata/pool-logical-create.argv
Normal file
1
tests/storagepoolxml2argvdata/pool-logical-create.argv
Normal file
@ -0,0 +1 @@
|
||||
vgchange -aly HostVG
|
1
tests/storagepoolxml2argvdata/pool-logical-noname.argv
Normal file
1
tests/storagepoolxml2argvdata/pool-logical-noname.argv
Normal file
@ -0,0 +1 @@
|
||||
vgchange -aly zily
|
1
tests/storagepoolxml2argvdata/pool-logical-nopath.argv
Normal file
1
tests/storagepoolxml2argvdata/pool-logical-nopath.argv
Normal file
@ -0,0 +1 @@
|
||||
vgchange -aly HostVG
|
1
tests/storagepoolxml2argvdata/pool-logical.argv
Normal file
1
tests/storagepoolxml2argvdata/pool-logical.argv
Normal file
@ -0,0 +1 @@
|
||||
vgchange -aly HostVG
|
@ -43,8 +43,11 @@ testCompareXMLToArgvFiles(bool shouldFail,
|
||||
cmd = virStorageBackendFileSystemMountCmd(def, src);
|
||||
break;
|
||||
|
||||
case VIR_STORAGE_POOL_DIR:
|
||||
case VIR_STORAGE_POOL_LOGICAL:
|
||||
cmd = virStorageBackendLogicalChangeCmd(def, true);
|
||||
break;
|
||||
|
||||
case VIR_STORAGE_POOL_DIR:
|
||||
case VIR_STORAGE_POOL_DISK:
|
||||
case VIR_STORAGE_POOL_ISCSI:
|
||||
case VIR_STORAGE_POOL_ISCSI_DIRECT:
|
||||
@ -137,10 +140,10 @@ mymain(void)
|
||||
DO_TEST_FAIL("pool-dir");
|
||||
DO_TEST_FAIL("pool-dir-naming");
|
||||
DO_TEST("pool-fs");
|
||||
DO_TEST_FAIL("pool-logical");
|
||||
DO_TEST_FAIL("pool-logical-nopath");
|
||||
DO_TEST_FAIL("pool-logical-create");
|
||||
DO_TEST_FAIL("pool-logical-noname");
|
||||
DO_TEST("pool-logical");
|
||||
DO_TEST("pool-logical-nopath");
|
||||
DO_TEST("pool-logical-create");
|
||||
DO_TEST("pool-logical-noname");
|
||||
DO_TEST_FAIL("pool-disk");
|
||||
DO_TEST_FAIL("pool-disk-device-nopartsep");
|
||||
DO_TEST_FAIL("pool-iscsi");
|
||||
|
Loading…
x
Reference in New Issue
Block a user