def test_volume_info(self): """ Test if it returns the volume info. """ res = { "myvol1": { "brickCount": "1", "bricks": { "brick1": { "hostUuid": "830700d7-0684-497c-a12c-c02e365fb90b", "path": "node01:/tmp/foo", "uuid": "830700d7-0684-497c-a12c-c02e365fb90b", } }, "disperseCount": "0", "distCount": "1", "id": "f03c2180-cf55-4f77-ae0b-3650f57c82a1", "name": "myvol1", "optCount": "1", "options": { "performance.readdir-ahead": "on" }, "redundancyCount": "0", "replicaCount": "1", "status": "1", "statusStr": "Started", "stripeCount": "1", "transport": "0", "type": "0", "typeStr": "Distribute", } } mock = MagicMock(return_value=xml_volume_info_running) with patch.dict(glusterfs.__salt__, {"cmd.run": mock}): self.assertDictEqual(glusterfs.info("myvol1"), res)
def test_volume_info(self): ''' Test if it returns the volume info. ''' res = { 'myvol1': { 'brickCount': '1', 'bricks': { 'brick1': { 'hostUuid': '830700d7-0684-497c-a12c-c02e365fb90b', 'path': 'node01:/tmp/foo', 'uuid': '830700d7-0684-497c-a12c-c02e365fb90b' } }, 'disperseCount': '0', 'distCount': '1', 'id': 'f03c2180-cf55-4f77-ae0b-3650f57c82a1', 'name': 'myvol1', 'optCount': '1', 'options': { 'performance.readdir-ahead': 'on' }, 'redundancyCount': '0', 'replicaCount': '1', 'status': '1', 'statusStr': 'Started', 'stripeCount': '1', 'transport': '0', 'type': '0', 'typeStr': 'Distribute' } } mock = MagicMock(return_value=xml_volume_info_running) with patch.dict(glusterfs.__salt__, {'cmd.run': mock}): self.assertDictEqual(glusterfs.info('myvol1'), res)
def test_volume_info(self): ''' Test if it returns the volume info. ''' res = {'myvol1': { 'brickCount': '1', 'bricks': { 'brick1': { 'hostUuid': '830700d7-0684-497c-a12c-c02e365fb90b', 'path': 'node01:/tmp/foo', 'uuid': '830700d7-0684-497c-a12c-c02e365fb90b'}}, 'disperseCount': '0', 'distCount': '1', 'id': 'f03c2180-cf55-4f77-ae0b-3650f57c82a1', 'name': 'myvol1', 'optCount': '1', 'options': { 'performance.readdir-ahead': 'on'}, 'redundancyCount': '0', 'replicaCount': '1', 'status': '1', 'statusStr': 'Started', 'stripeCount': '1', 'transport': '0', 'type': '0', 'typeStr': 'Distribute'}} mock = MagicMock(return_value=xml_volume_info_running) with patch.dict(glusterfs.__salt__, {'cmd.run': mock}): self.assertDictEqual(glusterfs.info('myvol1'), res)