From 2d1e44ebca9143f3ef28fa99afa1d596cd3447d2 Mon Sep 17 00:00:00 2001 From: "Richard (Rick) Hawkins" Date: Mon, 20 Jan 2014 12:26:46 -0600 Subject: [PATCH] Updating how cloudcafe gets info from swift. Change-Id: Id5a0e8424d44e1abfde0f8b48790d632b4f07d9e --- .../objectstorage/objectstorage_api/config.py | 13 +++++-- configs/objectstorage/saio.config | 39 +++++++++++++++---- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/cloudcafe/objectstorage/objectstorage_api/config.py b/cloudcafe/objectstorage/objectstorage_api/config.py index dc88414f..d4634976 100644 --- a/cloudcafe/objectstorage/objectstorage_api/config.py +++ b/cloudcafe/objectstorage/objectstorage_api/config.py @@ -23,11 +23,18 @@ class ObjectStorageAPIConfig(ConfigSectionInterface): ALL_FEATURES = '__ALL__' NO_FEATURES = '__NONE__' - ASK_SWIFT_FOR_FEATURES = '__ASK__' @property - def enabled_features(self): - return self.get('enabled_features', self.ALL_FEATURES) + def use_swift_info(self): + return self.get_boolean('use_swift_info', True) + + @property + def features(self): + return self.get('features', '') + + @property + def excluded_features(self): + return self.get('excluded_features', '') @property def object_expirer_run_interval(self): diff --git a/configs/objectstorage/saio.config b/configs/objectstorage/saio.config index 10ccde68..fa527695 100644 --- a/configs/objectstorage/saio.config +++ b/configs/objectstorage/saio.config @@ -21,14 +21,37 @@ username=test:tester password=testing [objectstorage_api] -# enabled_features - used to specify tests for features that are not -# configurable through middleware. Tests docarated with -# ObjectStorageFixture.required_features will requilred all -# features in the tag to be listed here in order to be run. -# in addition to listing the features here, '__ALL__', '__NONE__' and -# '__ASK__' can be provided to run all features tests, run no features -# tests or ask swift what features are configured and run only those. -enabled_features=__NONE__ +# Tells CloudCafe to attempt getting information from the swift cluster via +# the /info call. +#use_swift_info=True + +# Tests can be tagged with a decorator as follows: +# @ObjectStorageFixture.required_features('feature1', 'feature2') +# These tagged tests, will only be run if all of the features listed have +# been added to the features key. If use_swift_info is true, features will +# be pulled from the swift info and added to the features defined here. +# The features are defined by adding them to a whitespace separated list +# as follows: +# features=foo bar ... +# by defaut, no features are added. +#features= + +# In addition to setting the features, you can also exclude features from +# being reported. If for example you have the following: +# features=foo bar +# excluded_features=foo +# This will have the same efect as the following: +# features=bar +# The advantage of this is if there are features returned from the swift info +# call that you do not want to run regularly. The following special values +# can also be set: +# __ALL__ - runs all tests tagged with required_features, regardless of +# the features listed in the decorator. +# __NONE__ - runs no tests tagged with required_features, regardless of +# the features listed in the decorator. +# By default, no excluded features are set. +# excluded_features= + # object_expirer_run_interval - defines the interval that the script which # removes expiring objects runs. # object_expirer_run_interval=60