diff options
author | ShwethaHP <spandura@redhat.com> | 2017-08-03 05:33:27 +0530 |
---|---|---|
committer | ShwethaHP <spandura@redhat.com> | 2017-08-03 05:47:14 +0530 |
commit | f7f8b46c6d15a26576db0066efe8a93ab07f0a63 (patch) | |
tree | d878c03195a67422d10acd32a740bb2f602586de | |
parent | 9db25c3567bbc0897a64ab7856abf91ad2fe5af8 (diff) |
Set volume options on all the volume types
Providing a section in the config file to set volume options that can be
applicable to any volume type created. The glusterbase class also reads
the volume_options if provided in config file and set it on all the
volumes being created. These volume options will be overwritten if there
are any volume options specified while defining the volumes under 'volumes'
section.
Change-Id: I0003312251b4f8b151c9ba5c71d1b6a8884cc85e
Signed-off-by: ShwethaHP <spandura@redhat.com>
-rw-r--r-- | glustolibs-gluster/glustolibs/gluster/gluster_base_class.py | 9 | ||||
-rw-r--r-- | tests/gluster_tests_config.yml | 10 |
2 files changed, 18 insertions, 1 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py index 09946d739..ee7a23f3c 100644 --- a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py +++ b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py @@ -204,6 +204,13 @@ class GlusterBaseClass(unittest.TestCase): } } + # Default volume options which is applicable for all the volumes + cls.volume_options = {} + if ('volume_options' in g.config['gluster'] and + g.config['gluster']['volume_options']): + cls.volume_options = ( + g.config['gluster']['volume_options']) + # Get the volume configuration. cls.volume = {} if cls.volume_type: @@ -241,7 +248,7 @@ class GlusterBaseClass(unittest.TestCase): # Set volume options if 'options' not in cls.volume: - cls.volume['options'] = {} + cls.volume['options'] = cls.volume_options # Define Volume Useful Variables. cls.volname = cls.volume['name'] diff --git a/tests/gluster_tests_config.yml b/tests/gluster_tests_config.yml index d7783787a..bfc28232d 100644 --- a/tests/gluster_tests_config.yml +++ b/tests/gluster_tests_config.yml @@ -191,6 +191,16 @@ gluster: redundancy_count: 2 transport: tcp + # Volume options that has to be applicable to all volume types + volume_options: +## performance.quick-read: "off" +## performance.read-ahead: "off" +## performance.io-cache: "off" +## performance.stat-prefetch: "off" +## performance.open-behind: "off" +## performance.readdir-ahead: "off" +## server.allow-insecure: "on" + # slave volumes config goes under 'slave_volumes' section. This is a list # of all the slave volumes. slave_volumes: |