From 8acb5a7585a8e155cf0c9d0a60d76e75cdd725f7 Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Thu, 10 Apr 2014 16:49:05 +0530 Subject: 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 --- test/__init__.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'test/__init__.py') 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 -- cgit