]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Revert "radosgw-admin: update task for new usage reporting"
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 21 Sep 2012 18:19:01 +0000 (11:19 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Sat, 22 Sep 2012 00:18:07 +0000 (17:18 -0700)
This only works on the master branch of ceph.git right now.

This reverts commit d6c2ded087186d8587c6cebf215153c86bf5685d.

teuthology/task/radosgw-admin.py

index fd3025e9de76a27f2d65512522e252043e584a77..b4ad636591185987416076f1d5851ef6434c78ae 100644 (file)
@@ -18,13 +18,6 @@ from teuthology import misc as teuthology
 
 log = logging.getLogger(__name__)
 
-def successful_ops(out):
-    summary = out['summary']
-    if len(summary) == 0:
-        return 0
-    entry = summary[0]
-    return entry['total']['successful_ops']
-
 def rgwadmin(ctx, client, cmd):
     log.info('radosgw-admin: %s' % cmd)
     pre = [
@@ -321,8 +314,8 @@ def task(ctx, config):
     # need to wait for all usage data to get flushed, should take up to 30 seconds
     timestamp = time.time()
     while time.time() - timestamp <= 45:
-        (err, out) = rgwadmin(ctx, client, ['usage', 'show', '--categories', 'delete_obj'])  # last operation we did is delete obj, wait for it to flush
-        if successful_ops(out) > 0:
+        (err, out) = rgwadmin(ctx, client, ['usage', 'show'])
+        if len(out['entries']) > 0:
             break;
         time.sleep(1)
 
@@ -333,32 +326,17 @@ def task(ctx, config):
     assert not err
     assert len(out['entries']) > 0
     assert len(out['summary']) > 0
-    user_summary = out['summary'][0]
-    total = user_summary['total']
-    assert total['successful_ops'] > 0
+    for entry in out['summary']:
+        assert entry['successful_ops'] > 0
 
     # TESTCASE 'usage-show2' 'usage' 'show' 'user usage' 'succeeds'
     (err, out) = rgwadmin(ctx, client, ['usage', 'show', '--uid', user])
     assert not err
     assert len(out['entries']) > 0
     assert len(out['summary']) > 0
-    user_summary = out['summary'][0]
-    for entry in user_summary['categories']:
-        assert entry['successful_ops'] > 0
-    assert user_summary['user'] == user
-
-    # TESTCASE 'usage-show3' 'usage' 'show' 'user usage categories' 'succeeds'
-    test_categories = ['create_bucket', 'put_obj', 'delete_obj', 'delete_bucket']
-    for cat in test_categories:
-        (err, out) = rgwadmin(ctx, client, ['usage', 'show', '--uid', user, '--categories', cat])
-        assert not err
-        assert len(out['summary']) > 0
-        user_summary = out['summary'][0]
-        assert user_summary['user'] == user
-        assert len(user_summary['categories']) == 1
-        entry = user_summary['categories'][0]
-        assert entry['category'] == cat
+    for entry in out['summary']:
         assert entry['successful_ops'] > 0
+        assert entry['user'] == user
 
     # TESTCASE 'usage-trim' 'usage' 'trim' 'user usage' 'succeeds, usage removed'
     (err, out) = rgwadmin(ctx, client, ['usage', 'trim', '--uid', user])