summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorn darshan <dnarayan@redhat.com>2014-05-04 22:33:54 -0400
committerSahina Bose <sabose@redhat.com>2014-05-05 04:13:36 -0700
commit7dde70e063024c4b8d915697c9d0381704523afc (patch)
tree2495bfd2037c0a8018a5dffda3b8ce3b3feb894f /tests
parent65866b02ec24083f0206922b08dee3b26382a1be (diff)
gluster-nagios-common: Enhanced module for volumeQuotaStatus.
Enhanced the module volumeQuotaStatus to return the list of directories crossing the hard and soft limit along with quota status.Now this module returns a dictionary of following format: {status: OK|DISABLED|SOFT_LIMIT_EXCEEDED|HARD_LIMIT_EXCEEDED, hard_ex_dirs: ['dir1','dir2'.....], soft_ex_dirs: ['dir3','dir4'.....]} Change-Id: I4e8ebd622604d3d6bd28a078c73bad834d06da5d Signed-off-by: n darshan <dnarayan@redhat.com> Reviewed-on: http://review.gluster.org/7667 Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_glustercli.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/test_glustercli.py b/tests/test_glustercli.py
index 8f271a3..78c9170 100644
--- a/tests/test_glustercli.py
+++ b/tests/test_glustercli.py
@@ -1073,15 +1073,23 @@ class GlusterCliTests(TestCaseBase):
"Quota is not enabled on "
"volume demo-test-vol"], None
status = gcli.volumeQuotaStatus("test-vol")
- self.assertEquals(status, gcli.VolumeQuotaStatus.DISABLED)
+ exp_disabled_out = {'status': gcli.VolumeQuotaStatus.DISABLED,
+ 'hard_ex_dirs': [],
+ 'soft_ex_dirs': []}
+ self.assertEquals(status, exp_disabled_out)
mock_execCmd.return_value = 0, ["quota: No quota "
"configured on "
"volume demo-test-vol"], None
status = gcli.volumeQuotaStatus("test-vol")
- self.assertEquals(status, gcli.VolumeQuotaStatus.DISABLED)
+ self.assertEquals(status, exp_disabled_out)
mock_execCmd.return_value = 0, self.__getQuotaOut(), None
status = gcli.volumeQuotaStatus("test-vol")
- self.assertEquals(status, gcli.VolumeQuotaStatus.EXCEEDED)
+ exp_disabled_out = \
+ {'status': gcli.VolumeQuotaStatus.HARD_LIMIT_EXCEEDED,
+ 'hard_ex_dirs': ['/test/rewe'],
+ 'soft_ex_dirs': ['/test']}
+
+ self.assertEquals(status, exp_disabled_out)
@mock.patch('glusternagios.utils.execCmd')
@mock.patch('glusternagios.glustercli._getGlusterVolCmd')
@@ -1180,7 +1188,7 @@ class GlusterCliTests(TestCaseBase):
"-------------------------------------------------------------"
"--------------------------------------------------------------",
"/test 200.0KB 80% "
- " 200.0KB 0Bytes No No",
+ " 200.0KB 0Bytes Yes No",
"/test/rewe 200.0KB 80% "
"200.0KB 0Bytes Yes Yes"]