]> git-server-git.apps.pok.os.sepia.ceph.com Git - ragweed.git/commitdiff
ragweed: configurable bucket prefix
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 24 Jan 2017 22:37:31 +0000 (14:37 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 24 Jan 2017 22:37:31 +0000 (14:37 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
ragweed-example.conf
ragweed/framework.py

index 758325e8654f604568340f65946c22eb83ec0f4e..13393c3ab5a81fb3667fcb770f47a2741348279d 100644 (file)
@@ -14,6 +14,9 @@ port = 8000
 ## say "no" to disable TLS
 is_secure = no
 
+# bucket prefix
+bucket_prefix = ragweed
+
 [fixtures]
 
 [user regular]
index cd6406031566adb89cb4d53ac59f02d79f05a48c..381098e43b00fb7569be884a09390eafb6c83e7a 100644 (file)
@@ -79,8 +79,9 @@ class RGWRESTAdmin:
 
 
 class RSuite:
-    def __init__(self, name, zone, suite_step):
+    def __init__(self, name, bucket_prefix, zone, suite_step):
         self.name = name
+        self.bucket_prefix = bucket_prefix
         self.zone = zone
         self.config_bucket = None
         self.rtests = []
@@ -95,7 +96,7 @@ class RSuite:
                 self.config_bucket = self.zone.get_raw_bucket(self.get_bucket_name('conf'))
 
     def get_bucket_name(self, suffix):
-        return self.name + '-' + suffix
+        return self.bucket_prefix + '-' + suffix
 
     def register_test(self, t):
         self.rtests.append(t)
@@ -289,6 +290,7 @@ str_config_opts = [
                 'secret_key',
                 'host',
                 'ceph_conf',
+                'bucket_prefix',
                 ]
 
 int_config_opts = [
@@ -356,12 +358,17 @@ class RagweedEnv:
 
         rgw_conf = self.config.rgw
 
+        try:
+            self.bucket_prefix = rgw_conf.bucket_prefix
+        except:
+            self.bucket_prefix = 'ragweed'
+
         conn = bunch.Bunch()
         for (k, u) in self.config.user.iteritems():
             conn[k] = RGWConnection(u.access_key, u.secret_key, rgw_conf.host, dict_find(rgw_conf, 'port'), dict_find(rgw_conf, 'is_secure'))
 
         self.zone = RZone(conn)
-        self.suite = RSuite('ragweed', self.zone, os.environ['RAGWEED_RUN'])
+        self.suite = RSuite('ragweed', self.bucket_prefix, self.zone, os.environ['RAGWEED_RUN'])
 
         try:
             self.ceph_conf = self.config.rados.ceph_conf
@@ -378,7 +385,6 @@ class RagweedEnv:
         for pool in pools:
              print "rados pool>", pool
 
-
 def setup_module():
     global ragweed_env
     global suite