diff options
author | Prashanth Pai <ppai@redhat.com> | 2014-04-10 16:49:05 +0530 |
---|---|---|
committer | Gerrit Code Review <review@dev.gluster.org> | 2014-05-19 18:34:48 -0700 |
commit | 8acb5a7585a8e155cf0c9d0a60d76e75cdd725f7 (patch) | |
tree | 45ffd1ca45cce932b2916a71d94e150fe770db08 /test/__init__.py | |
parent | da5a33d206431f885a4dc029d79f693a27ef293a (diff) |
Fix functional tests
* The order of elements in list returned by listdir() can vary and may
not be sorted. This caused assertEqual in "test_listdir" to fail.
* Also, some systems may have xattrs belonging to selinux. So, a
listxattr can list them too.
* Allow hostname/ip and volume name to be configured easily by setting
it in test.conf. This enables functional tests to use a non-local volume.
* Cleanup volume before and after running functional tests.
* Added MANIFEST.in and LICENSE file
Change-Id: Icfa6eb60e8d8e7ed4d6ab8190a2a2c80688999a3
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'test/__init__.py')
-rw-r--r-- | test/__init__.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/__init__.py b/test/__init__.py index e69de29..821f5e3 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -0,0 +1,32 @@ +# Copyright (c) 2012-2014 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import os +import ConfigParser + + +def get_test_config(): + """ + Reads test.conf config file which contains configurable options + to run functional tests. + + :returns: ConfigParser instance if test.conf found, None otherwise. + """ + dirname = os.path.dirname(__file__) + conf_file = dirname + "/test.conf" + if os.path.exists(conf_file): + config = ConfigParser.ConfigParser() + config.read(conf_file) + return config + return None |