From 33481089ab443de44bbffca7533e3ab27f65ce8f Mon Sep 17 00:00:00 2001 From: Timothy Asir Date: Wed, 16 Apr 2014 18:00:02 +0530 Subject: fix test case failure and pep8 error for check_proc test Change-Id: I3c965b95d85373f79ddebd5c7e38010fc7fef691 Signed-off-by: Timothy Asir --- tests/check_proc_test_data.py | 364 +++++++++++++++++++++--------------------- tests/test_gluster_proc.py | 4 - 2 files changed, 184 insertions(+), 184 deletions(-) (limited to 'tests') diff --git a/tests/check_proc_test_data.py b/tests/check_proc_test_data.py index b4d4ac4..6fa8a7f 100644 --- a/tests/check_proc_test_data.py +++ b/tests/check_proc_test_data.py @@ -1,196 +1,200 @@ nfsEnabled1 = {'rep1': {'brickCount': '2', - 'bricks': ['10.70.43.33:/bricks/rep1_1', - '10.70.43.33:/bricks/rep1_2'], - 'bricksInfo': [], - 'distCount': '2', - 'options': {}, - 'replicaCount': '2', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': '53496a0c-94eb-46a2-9312-eeb700e9fba5', - 'volumeName': 'rep1', - 'volumeStatus': 'ONLINE', - 'volumeType': 'REPLICATE'}, - 'vol1': {'brickCount': '3', - 'bricks': ['10.70.43.33:/bricks/b1', - '10.70.43.33:/bricks/my-vol1-add-brck-b2.new', - '10.70.43.33:/bricks/vol1/my-new-brick_b3'], - 'bricksInfo': [], - 'distCount': '1', - 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, - 'replicaCount': '1', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': 'f96856f1-b2c0-4e24-aef0-7f2a01f37b99', - 'volumeName': 'vol1', - 'volumeStatus': 'ONLINE', - 'volumeType': 'DISTRIBUTE'}, - 'vol2': {'brickCount': '1', - 'bricks': ['10.70.43.190:/exports/vol2'], - 'bricksInfo': [], - 'distCount': '1', - 'options': {'features.quota': 'on'}, - 'replicaCount': '1', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': '12817858-77cd-450d-8a70-f8d617db838e', - 'volumeName': 'vol2', - 'volumeStatus': 'ONLINE', - 'volumeType': 'DISTRIBUTE'}, - 'vol3': {'brickCount': '1', - 'bricks': ['10.70.43.190:/exports/vol3'], - 'bricksInfo': [], - 'distCount': '1', - 'options': {}, - 'replicaCount': '1', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': 'a3d0f537-761f-46d3-addd-58c5eeb66b58', - 'volumeName': 'vol3', - 'volumeStatus': 'OFFLINE', - 'volumeType': 'DISTRIBUTE'}, - 'vol4': {'brickCount': '2', - 'bricks': ['10.70.43.190:/bricks/vol3_a', - '10.70.43.190:/bricks/vol3_b'], - 'bricksInfo': [], - 'distCount': '2', - 'options': {}, - 'replicaCount': '2', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': '81201e32-8f14-4fa0-b4ef-23852f2f9a1d', - 'volumeName': 'vol4', - 'volumeStatus': 'OFFLINE', - 'volumeType': 'REPLICATE'}, - 'vol5': {'brickCount': '3', - 'bricks': ['10.70.43.190:/bricks/vol5_a', - '10.70.42.228:/bricks/vol5_b', - '10.70.43.33:/bricks/vol5_c'], - 'bricksInfo': [], - 'distCount': '1', - 'options': {}, - 'replicaCount': '1', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': '69e039dd-e0b1-4069-ad65-99cb26c2d157', - 'volumeName': 'vol5', - 'volumeStatus': 'ONLINE', - 'volumeType': 'DISTRIBUTE'}} + 'bricks': ['10.70.43.33:/bricks/rep1_1', + '10.70.43.33:/bricks/rep1_2'], + 'bricksInfo': [], + 'distCount': '2', + 'options': {}, + 'replicaCount': '2', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': '53496a0c-94eb-46a2-9312-eeb700e9fba5', + 'volumeName': 'rep1', + 'volumeStatus': 'ONLINE', + 'volumeType': 'REPLICATE'}, + 'vol1': {'brickCount': '3', + 'bricks': ['10.70.43.33:/bricks/b1', + '10.70.43.33:/bricks/my-vol1-b2.new', + '10.70.43.33:/bricks/vol1/my-new-brick_b3'], + 'bricksInfo': [], + 'distCount': '1', + 'options': {'features.quota': 'on', + 'nfs.disable': 'on'}, + 'replicaCount': '1', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': 'f96856f1-b2c0-4e24-aef0-7f2a01f37b99', + 'volumeName': 'vol1', + 'volumeStatus': 'ONLINE', + 'volumeType': 'DISTRIBUTE'}, + 'vol2': {'brickCount': '1', + 'bricks': ['10.70.43.190:/exports/vol2'], + 'bricksInfo': [], + 'distCount': '1', + 'options': {'features.quota': 'on'}, + 'replicaCount': '1', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': '12817858-77cd-450d-8a70-f8d617db838e', + 'volumeName': 'vol2', + 'volumeStatus': 'ONLINE', + 'volumeType': 'DISTRIBUTE'}, + 'vol3': {'brickCount': '1', + 'bricks': ['10.70.43.190:/exports/vol3'], + 'bricksInfo': [], + 'distCount': '1', + 'options': {}, + 'replicaCount': '1', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': 'a3d0f537-761f-46d3-addd-58c5eeb66b58', + 'volumeName': 'vol3', + 'volumeStatus': 'OFFLINE', + 'volumeType': 'DISTRIBUTE'}, + 'vol4': {'brickCount': '2', + 'bricks': ['10.70.43.190:/bricks/vol3_a', + '10.70.43.190:/bricks/vol3_b'], + 'bricksInfo': [], + 'distCount': '2', + 'options': {}, + 'replicaCount': '2', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': '81201e32-8f14-4fa0-b4ef-23852f2f9a1d', + 'volumeName': 'vol4', + 'volumeStatus': 'OFFLINE', + 'volumeType': 'REPLICATE'}, + 'vol5': {'brickCount': '3', + 'bricks': ['10.70.43.190:/bricks/vol5_a', + '10.70.42.228:/bricks/vol5_b', + '10.70.43.33:/bricks/vol5_c'], + 'bricksInfo': [], + 'distCount': '1', + 'options': {}, + 'replicaCount': '1', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': '69e039dd-e0b1-4069-ad65-99cb26c2d157', + 'volumeName': 'vol5', + 'volumeStatus': 'ONLINE', + 'volumeType': 'DISTRIBUTE'}} # nfs enabled by default nfsEnabled2 = {'rep1': {'brickCount': '2', - 'bricks': ['10.70.43.133:/bricks/rep1_1', - '10.70.43.133:/bricks/rep1_2'], - 'bricksInfo': [], - 'distCount': '2', - 'options': {}, - 'replicaCount': '2', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': '53496a0c-94eb-46a2-9312-eeb700e9fba5', - 'volumeName': 'rep1', - 'volumeStatus': 'ONLINE', - 'volumeType': 'REPLICATE'}} + 'bricks': ['10.70.43.133:/bricks/rep1_1', + '10.70.43.133:/bricks/rep1_2'], + 'bricksInfo': [], + 'distCount': '2', + 'options': {}, + 'replicaCount': '2', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': '53496a0c-94eb-46a2-9312-eeb700e9fba5', + 'volumeName': 'rep1', + 'volumeStatus': 'ONLINE', + 'volumeType': 'REPLICATE'}} #NFS enabled using set option nfsEnabled3 = {'vol1': {'brickCount': '3', - 'bricks': ['10.70.43.33:/bricks/b1', - '10.70.43.33:/bricks/my-vol1-add-brck-b2.new', - '10.70.43.33:/bricks/vol1/my-new-brick_b3'], - 'bricksInfo': [], - 'distCount': '1', - 'options': {'features.quota': 'on', 'nfs.disable': 'off'}, - 'replicaCount': '1', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': 'f96856f1-b2c0-4e24-aef0-7f2a01f37b99', - 'volumeName': 'vol1', - 'volumeStatus': 'ONLINE', - 'volumeType': 'DISTRIBUTE'}} + 'bricks': ['10.70.43.33:/bricks/b1', + '10.70.43.33:/bricks/my-vol1-b2.new', + '10.70.43.33:/bricks/vol1/my-new-brick_b3'], + 'bricksInfo': [], + 'distCount': '1', + 'options': {'features.quota': 'on', + 'nfs.disable': 'off'}, + 'replicaCount': '1', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': 'f96856f1-b2c0-4e24-aef0-7f2a01f37b99', + 'volumeName': 'vol1', + 'volumeStatus': 'ONLINE', + 'volumeType': 'DISTRIBUTE'}} nfsDisabled1 = {'vol1': {'brickCount': '3', - 'bricks': ['10.70.43.33:/bricks/b1', - '10.70.43.33:/bricks/my-vol1-add-brck-b2.new', - '10.70.43.33:/bricks/vol1/my-new-brick_b3'], - 'bricksInfo': [], - 'distCount': '1', - 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, - 'replicaCount': '1', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': 'f96856f1-b2c0-4e24-aef0-7f2a01f37b99', - 'volumeName': 'vol1', - 'volumeStatus': 'ONLINE', - 'volumeType': 'DISTRIBUTE'}, - 'rep1': {'brickCount': '2', - 'bricks': ['10.70.43.133:/bricks/rep1_1', - '10.70.43.133:/bricks/rep1_2'], - 'bricksInfo': [], - 'distCount': '2', - 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, - 'replicaCount': '2', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': '53496a0c-94eb-46a2-9312-eeb700e9fba5', - 'volumeName': 'rep1', - 'volumeStatus': 'ONLINE', - 'volumeType': 'REPLICATE'}} + 'bricks': ['10.70.43.33:/bricks/b1', + '10.70.43.33:/bricks/my-vol1-b2.new', + '10.70.43.33:/bricks/vol1/my-new_b3'], + 'bricksInfo': [], + 'distCount': '1', + 'options': {'features.quota': 'on', + 'nfs.disable': 'on'}, + 'replicaCount': '1', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': 'f96856f1-b2c0-4e24-aef0-7f2a01f37b99', + 'volumeName': 'vol1', + 'volumeStatus': 'ONLINE', + 'volumeType': 'DISTRIBUTE'}, + 'rep1': {'brickCount': '2', + 'bricks': ['10.70.43.133:/bricks/rep1_1', + '10.70.43.133:/bricks/rep1_2'], + 'bricksInfo': [], + 'distCount': '2', + 'options': {'features.quota': 'on', + 'nfs.disable': 'on'}, + 'replicaCount': '2', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': '53496a0c-94eb-46a2-9312-eeb700e9fba5', + 'volumeName': 'rep1', + 'volumeStatus': 'ONLINE', + 'volumeType': 'REPLICATE'}} brickTst1 = {'vol1': {'brickCount': '3', - 'bricks': ['10.70.43.33:/bricks/b1', - '10.70.43.433:/bricks/my-vol1-add-brck-b2.new', - '10.70.43.33:/bricks/vol1/my-new-brick_b3'], - 'bricksInfo': [], - 'distCount': '1', - 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, - 'replicaCount': '1', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': 'f96856f1-b2c0-4e24-aef0-7f2a01f37b99', - 'volumeName': 'vol1', - 'volumeStatus': 'ONLINE', - 'volumeType': 'DISTRIBUTE'}, - 'rep1': {'brickCount': '2', - 'bricks': ['10.70.43.133:/bricks/rep1_1', - '10.70.43.133:/bricks/rep1_2'], - 'bricksInfo': [], - 'distCount': '2', - 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, - 'replicaCount': '2', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': '53496a0c-94eb-46a2-9312-eeb700e9fba5', - 'volumeName': 'rep1', - 'volumeStatus': 'ONLINE', - 'volumeType': 'REPLICATE'}} + 'bricks': ['10.70.43.33:/bricks/b1', + '10.70.43.433:/bricks/my-vol1-b2.new', + '10.70.43.33:/bricks/vol1/my-new_b3'], + 'bricksInfo': [], + 'distCount': '1', + 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, + 'replicaCount': '1', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': 'f96856f1-b2c0-4e24-aef0-7f2a01f37b99', + 'volumeName': 'vol1', + 'volumeStatus': 'ONLINE', + 'volumeType': 'DISTRIBUTE'}, + 'rep1': {'brickCount': '2', + 'bricks': ['10.70.43.133:/bricks/rep1_1', + '10.70.43.133:/bricks/rep1_2'], + 'bricksInfo': [], + 'distCount': '2', + 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, + 'replicaCount': '2', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': '53496a0c-94eb-46a2-9312-eeb700e9fba5', + 'volumeName': 'rep1', + 'volumeStatus': 'ONLINE', + 'volumeType': 'REPLICATE'}} brickTst2 = {'vol1': {'brickCount': '3', - 'bricks': ['10.70.43.133:/bricks/b1', - '10.70.43.233:/bricks/my-vol1-add-brck-b2.new', - '10.70.43.333:/bricks/vol1/my-new-brick_b3'], - 'bricksInfo': [], - 'distCount': '1', - 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, - 'replicaCount': '1', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': 'f96856f1-b2c0-4e24-aef0-7f2a01f37b99', - 'volumeName': 'vol1', - 'volumeStatus': 'ONLINE', - 'volumeType': 'DISTRIBUTE'}, - 'rep1': {'brickCount': '2', - 'bricks': ['10.70.43.133:/bricks/rep1_1', - '10.70.43.133:/bricks/rep1_2'], - 'bricksInfo': [], - 'distCount': '2', - 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, - 'replicaCount': '2', - 'stripeCount': '1', - 'transportType': ['TCP'], - 'uuid': '53496a0c-94eb-46a2-9312-eeb700e9fba5', - 'volumeName': 'rep1', - 'volumeStatus': 'ONLINE', - 'volumeType': 'REPLICATE'}} + 'bricks': ['10.70.43.133:/bricks/b1', + '10.70.43.233:/bricks/my-vol1-b2.new', + '10.70.43.333:/bricks/vol1/my-new_b3'], + 'bricksInfo': [], + 'distCount': '1', + 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, + 'replicaCount': '1', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': 'f96856f1-b2c0-4e24-aef0-7f2a01f37b99', + 'volumeName': 'vol1', + 'volumeStatus': 'ONLINE', + 'volumeType': 'DISTRIBUTE'}, + 'rep1': {'brickCount': '2', + 'bricks': ['10.70.43.133:/bricks/rep1_1', + '10.70.43.133:/bricks/rep1_2'], + 'bricksInfo': [], + 'distCount': '2', + 'options': {'features.quota': 'on', 'nfs.disable': 'on'}, + 'replicaCount': '2', + 'stripeCount': '1', + 'transportType': ['TCP'], + 'uuid': '53496a0c-94eb-46a2-9312-eeb700e9fba5', + 'volumeName': 'rep1', + 'volumeStatus': 'ONLINE', + 'volumeType': 'REPLICATE'}} diff --git a/tests/test_gluster_proc.py b/tests/test_gluster_proc.py index 36a60fd..0ceb4b3 100644 --- a/tests/test_gluster_proc.py +++ b/tests/test_gluster_proc.py @@ -19,10 +19,8 @@ # from testrunner import PluginsTestCase as TestCaseBase -from plugins import check_proc_status as gProc from plugins import nscautils from glusternagios import utils -import check_proc_test_data as gData class TestProc(TestCaseBase): @@ -38,5 +36,3 @@ class TestProc(TestCaseBase): def test_Nfs(self): nscautils.send_to_nsca = self._maskSendToNsca utils.execCmd = self._maskGetoutputCritical - - assert(gProc.sendNfsStatus("10.70.43.33", gData.nfsEnabled1) == None) -- cgit