Piotr Kliczewski has uploaded a new change for review. Change subject: yml: schema validation tests ......................................................................
yml: schema validation tests Change-Id: I2420908ebb39136339a5a52daf12f359836c5291 Signed-off-by: Piotr Kliczewski <[email protected]> --- M tests/vdsmapi_test.py 1 file changed, 216 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/60071/1 diff --git a/tests/vdsmapi_test.py b/tests/vdsmapi_test.py index 9ae1668..30f5c9a 100644 --- a/tests/vdsmapi_test.py +++ b/tests/vdsmapi_test.py @@ -458,3 +458,219 @@ sub_id = '|virt|VM_status|426aef82-ea1d-4442-91d3-fd876540e0f0' _events_schema.events_schema().verify_event_params(sub_id, params) + + def test_connect_server(self): + params = {u'connectionParams': + [{u'id': u'a454a600-b3b7-46ea-8032-717deedcd219', + u'connection': u'10.35.0.99', + u'iqn': u'iqn.2003-01.org.dumbo.target1', + u'user': u'', + u'tpgt': u'1', + u'password': '********', + u'port': u'3260'}, + {u'id': u'48b086ae-6d80-4d6f-96ac-43c6ffcaab3e', + u'connection': u'10.35.0.99', + u'iqn': u'iqn.2003-01.org.dumbo.target2', + u'user': u'', + u'tpgt': u'1', + u'password': '********', + u'port': u'3260'}], + u'storagepoolID': u'636d9c59-f7ba-4115-87a1-44d6563a9610', + u'domainType': 3} + + _schema.schema().verify_args( + vdsmapi.MethodRep('StoragePool', 'connectStorageServer'), + params) + + def test_sp_connect(self): + params = {u'masterVersion': 33, + u'domainDict': + {u'0900c0cd-8422-497a-85c5-1bb34b2b6b65': u'active', + u'794dc113-315f-43e3-ae47-0b7b1bf56427': u'active', + u'1d8235ee-c2ce-4c06-abd5-63b655fd66c5': u'active'}, + u'storagepoolID': u'636d9c59-f7ba-4115-87a1-44d6563a9610', + u'scsiKey': u'636d9c59-f7ba-4115-87a1-44d6563a9610', + u'masterSdUUID': u'3d4accf7-74af-4ea0-b59b-eb9f10eedb83', + u'hostID': 1} + + _schema.schema().verify_args( + vdsmapi.MethodRep('StoragePool', 'connect'), params) + + def test_host_list_caps(self): + ret = {'net_eth0_52_54_00_56_00_39': + {'params': {'capability': 'net', + 'interface': 'eth0', + 'parent': 'pci_0000_00_03_0', + 'is_assignable': 'true'}}, + 'computer': + {'params': {'capability': 'system', + 'is_assignable': 'true', + 'product': 'Standard PC (i440FX + PIIX, 1996)'}}, + 'usb_1_1_1_0': + {'params': {'capability': 'usb', + 'is_assignable': 'true', + 'driver': 'usbhid', + 'parent': 'usb_1_1'}}, + 'scsi_target7_0_0': + {'params': {'capability': 'scsi_target', + 'is_assignable': 'true', + 'parent': 'scsi_host7'}}, + 'usb_usb1': + {'params': {'product': '2.0 root hub', + 'vendor': 'Linux Foundation', + 'product_id': '0x0002', + 'parent': 'pci_0000_00_05_7', + 'vendor_id': '0x1d6b', + 'driver': 'usb', + 'capability': 'usb_device', + 'is_assignable': 'true', + 'address': {'device': '1', 'bus': '1'}}}, + 'pci_0000_00_02_0': + {'params': {'product': 'QXL paravirtual graphic card', + 'vendor': 'Red Hat, Inc.', + 'product_id': '0x0100', + 'parent': 'computer', + 'vendor_id': '0x1b36', + 'driver': 'qxl', + 'capability': 'pci', + 'is_assignable': 'true', + 'address': {'slot': '2', + 'bus': '0', + 'domain': '0', + 'function': '0'}}}, + 'scsi_5_0_0_18': + {'params': {'product': 'target1-18', + 'vendor': 'LIO-ORG', + 'parent': 'scsi_target5_0_0', + 'driver': 'sd', + 'capability': 'scsi', + 'is_assignable': 'true', + 'udev_path': '/dev/sg2', + 'address': {'bus': '0', + 'host': '5', + 'target': '0', + 'lun': '18'}}}, + 'scsi_host5': + {'params': {'capability': 'scsi_host', + 'is_assignable': 'true', + 'parent': 'computer'}}, + 'scsi_generic_sg26': + {'params': {'capability': 'scsi_generic', + 'is_assignable': 'true', + 'udev_path': '/dev/sg26', + 'parent': 'scsi_6_0_0_14'}}, + 'scsi_6_0_0_14': + {'params': {'product': 'target2-14', + 'vendor': 'LIO-ORG', + 'parent': 'scsi_target6_0_0', + 'driver': 'sd', + 'capability': 'scsi', + 'is_assignable': 'true', + 'udev_path': '/dev/sg26', + 'address': {'bus': '0', + 'host': '6', + 'target': '0', + 'lun': '14'}}}, + 'block_sdr_36001405292bb96f19064f81b884fa63f': + {'params': {'capability': 'storage', + 'is_assignable': 'true', + 'product': 'target1-03', + 'vendor': 'LIO-ORG', + 'parent': 'scsi_5_0_0_3'}}} + + _schema.schema().verify_retval( + vdsmapi.MethodRep('Host', 'hostdevListByCaps'), ret) + + def test_start_spm(self): + params = {u'prevLver': u'-1', + u'enableScsiFencing': u'false', + u'storagepoolID': u'636d9c59-f7ba-4115-87a1-44d6563a9610', + u'prevID': -1, + u'domVersion': u'3', + u'maxHostID': 250} + + _schema.schema().verify_args( + vdsmapi.MethodRep('StoragePool', 'spmStart'), params) + + def test_task_status(self): + ret = {'code': 0, + 'message': 'running job 1 of 1', + 'taskState': 'running', + 'taskResult': '', + 'taskID': '72fdf1ca-8826-4688-9c8c-e175d4253e2a'} + + _schema.schema().verify_retval( + vdsmapi.MethodRep('Task', 'getStatus'), ret) + + def test_spm_status(self): + ret = {'spmId': 1, 'spmStatus': 'SPM', 'spmLver': 10} + + _schema.schema().verify_retval( + vdsmapi.MethodRep('StoragePool', 'getSpmStatus'), ret) + + def test_info_storage(self): + ret = {'info': + {'name': 'No Description', + 'isoprefix': '', + 'pool_status': 'connected', + 'lver': 10, + 'domains': u'0900c0cd-8422-497a-85c5-1bb34b2b6b65:Active,794d', + 'master_uuid': '3d4accf7-74af-4ea0-b59b-eb9f10eedb83', + 'version': '3', + 'spm_id': 1, + 'type': 'ISCSI', + 'master_ver': 33}, + 'dominfo': {u'0900c0cd-8422-497a-85c5-1bb34b2b6b65': + {'status': u'Active', + 'diskfree': '48855252992', + 'isoprefix': '', + 'alerts': [], + 'disktotal': '53284438016', + 'version': 3}, + u'794dc113-315f-43e3-ae47-0b7b1bf56427': + {'status': u'Active', + 'diskfree': '48855252992', + 'isoprefix': '', + 'alerts': [], + 'disktotal': '53284438016', + 'version': 3}}} + + _schema.schema().verify_retval( + vdsmapi.MethodRep('StoragePool', 'getInfo'), ret) + + def test_volume_group_info(self): + ret = {'state': 'OK', + 'vgsize': '53284438016', + 'name': 'b0d9c2e8-00e9-4e0e-a5d9-f9e17bb59974', + 'vgfree': '48855252992', + 'vgUUID': 'aE6hIQ-WY4M-yvgK-rNQi-YN4G-mauM-1xKp56', + 'pvlist': [{'vendorID': 'LIO-ORG', + 'capacity': '53284438016', + 'fwrev': '0000', + 'vgUUID': 'aE6hIQ-WY4M-yvgK-rNQi-YN4G-mauM-1xKp56', + 'pathlist': [{'connection': '10.35.0.99', + 'iqn': 'iqn.2003-01.org.dumbo.target', + 'portal': '1', + 'port': '3260', + 'initiatorname': 'default'}], + 'pathstatus': [{'type': 'iSCSI', + 'physdev': 'sdbh', + 'capacity': '53687091200', + 'state': 'active', + 'lun': '1'}], + 'devtype': 'iSCSI', + 'pvUUID': 'mzQhIy-eyno-YUaE-eFod-9JQU-AYeA-xgy0ma', + 'serial': 'SLIO-ORG_target3-01_77f3fd04-8038-4383-', + 'GUID': '3600140577f3fd048038438393cce45de', + 'devcapacity': '53687091200', + 'productID': 'target3-01'}], + 'type': 3, + 'attr': {'allocation': 'n', + 'partial': '-', + 'exported': '-', + 'permission': 'w', + 'clustered': '-', + 'resizeable': 'z'}} + + _schema.schema().verify_retval( + vdsmapi.MethodRep('LVMVolumeGroup', 'getInfo'), ret) -- To view, visit https://gerrit.ovirt.org/60071 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2420908ebb39136339a5a52daf12f359836c5291 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Piotr Kliczewski <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/admin/lists/[email protected]
