summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShubhendu Tripathi <shtripat@redhat.com>2014-04-14 14:17:08 +0530
committerBala.FA <barumuga@redhat.com>2014-04-28 16:20:46 +0530
commit935996d152a87a2b27d2b43f85f3bca710a4e555 (patch)
tree3c72671c8c5985b893c5b41e41bed56bb45f7486 /tests
parentfc90d056a6840739dd774954afbdf2d82375e858 (diff)
gluster-nagios-common: Fixed test failure for gluster
Fixed the test failure because of gluster command Change-Id: Ica6cd01c17e6bc9a9951bfe2c488eb6a359af447 Signed-off-by: Shubhendu Tripathi <shtripat@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_storage.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_storage.py b/tests/test_storage.py
index 33c1389..f080430 100644
--- a/tests/test_storage.py
+++ b/tests/test_storage.py
@@ -280,6 +280,7 @@ class TestStorageUtils(TestCaseBase):
'LVM2_PV_PE_COUNT': '12674'}}
self.assertEquals(ret_val, value_to_verify)
+ @mock.patch('glusternagios.storage._getBrickMountPoints')
@mock.patch('glusternagios.storage._getMountPoint')
@mock.patch('glusternagios.storage._getProcMounts')
@mock.patch('glusternagios.storage.glustercli.utils')
@@ -288,7 +289,8 @@ class TestStorageUtils(TestCaseBase):
mock_get_lv_details,
mock_utils,
mock_proc_mounts,
- mock_get_mount_point):
+ mock_get_mount_point,
+ mock_get_brick_mount_points):
mock_get_lv_details.return_value = {'lv_root':
{'LVM2_LV_NAME': 'lv_root',
'LVM2_PV_NAME': '/dev/vda2',
@@ -333,16 +335,19 @@ class TestStorageUtils(TestCaseBase):
'/proc/bus/usb': '/proc/bus/usb',
'proc': '/proc'}
mock_get_mount_point.return_value = "/"
+ mock_get_brick_mount_points.return_value = {'server-1:/tmp/vol1-a': "/"}
bricks = glusternagios.storage.getBricksForDisk("/dev/vda2")
self.assertEquals(bricks, ['server-1:/tmp/vol1-a'])
+ @mock.patch('glusternagios.storage._getBrickDeviceName')
@mock.patch('glusternagios.storage._getLvDetails')
@mock.patch('glusternagios.storage.glustercli.utils')
@mock.patch('glusternagios.storage._getMountPoint')
def testGetDisksForBrick(self,
mock_get_mount_point,
mock_utils,
- mock_get_lv_details):
+ mock_get_lv_details,
+ mock_get_brick_device_name):
mock_get_mount_point.return_value = "/"
tmp_out = ['<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',
'<cliOutput>',
@@ -383,6 +388,8 @@ class TestStorageUtils(TestCaseBase):
disk = glusternagios.storage.getDisksForBrick("server-1:"
"/tmp/vol1-a")
self.assertEquals(disk, "/dev/vda2")
+ mock_get_brick_device_name.return_value = "/dev/mapper/" \
+ "vg_shubhnd-lv_root"
disk = glusternagios.storage.getDisksForBrick("server-1:/tmp/vol1-a",
"/dev/mapper/"