summaryrefslogtreecommitdiffstats
path: root/tests/functional
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2020-02-24 19:05:13 +0530
committerBala Konda Reddy M <bala12352@gmail.com>2020-02-25 12:09:01 +0000
commitaf70b67038c196b4d4a8b4ec9830483d9e687972 (patch)
tree195f6c83bc042aecf31182bbf3a177147d6dc6c0 /tests/functional
parent87638f2ab5379c04dfdf87329ebe450c24ac25bc (diff)
[Testfix] Modify test to work with new performance.io-cache default
Problem: The default value of performance.io-cache was ON by default before gluster 6.0, in gluster 6.0 it was set to OFF. Solution: Adding code to check gluster version and then check weather it is ON or OFF as shown below: ``` if get_gluster_version(self.mnode) >= 6.0: self.assertIn("off", ret['performance.io-cache'], "io-cache value is not correct") else: self.assertIn("on", ret['performance.io-cache'], "io-cache value is not correct") ``` CentOS-CI failure analysis: This patch is expected to failed as if we run `gluster --version` on nightly builds the output returned as shown below: ``` # gluster --version glusterfs 20200220.a0e0890 Repository revision: git://git.gluster.org/glusterfs.git Copyright (c) 2006-2016 Red Hat, Inc. <https://www.gluster.org/> GlusterFS comes with ABSOLUTELY NO WARRANTY. It is licensed to you under your choice of the GNU Lesser General Public License, version 3 or any later version (LGPLv3 or later), or the GNU General Public License, version 2 (GPLv2), in all cases as published by the Free Software Foundation. ``` This output can't be parsed by get_gluster_version() function which is used in this patch to get the gluster version and check for perfromance.io-cache's default value accordingly. Change-Id: I00b652a9d5747cbf3006825bb17b9ca2f69cb9cd Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/glusterd/test_volume_get.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/functional/glusterd/test_volume_get.py b/tests/functional/glusterd/test_volume_get.py
index a451268f7..d38380f60 100644
--- a/tests/functional/glusterd/test_volume_get.py
+++ b/tests/functional/glusterd/test_volume_get.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2017-2018 Red Hat, Inc. <http://www.redhat.com>
+# Copyright (C) 2017-2020 Red Hat, Inc. <http://www.redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,6 +24,7 @@ from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on
from glustolibs.gluster.volume_ops import (get_volume_options,
set_volume_options)
from glustolibs.gluster.lib_utils import is_core_file_created
+from glustolibs.gluster.gluster_init import get_gluster_version
@runs_on([['distributed', 'replicated', 'distributed-replicated',
@@ -175,8 +176,12 @@ class TestVolumeGet(GlusterBaseClass):
ret = get_volume_options(self.mnode, self.volname, "io-cache")
self.assertIsNotNone(ret, "gluster volume get %s io-cache command "
"failed" % self.volname)
- self.assertIn("on", ret['performance.io-cache'], "io-cache value "
- "is not correct")
+ if get_gluster_version(self.mnode) >= 6.0:
+ self.assertIn("off", ret['performance.io-cache'],
+ "io-cache value is not correct")
+ else:
+ self.assertIn("on", ret['performance.io-cache'],
+ "io-cache value is not correct")
g.log.info("io-cache value is correct")
# Performing gluster volume set volname performance.low-prio-threads