diff options
author | Thiago da Silva <thiago@redhat.com> | 2013-10-29 17:08:03 -0400 |
---|---|---|
committer | Luis Pabon <lpabon@redhat.com> | 2013-10-30 16:57:46 -0700 |
commit | 9f8d2e61a79defd22fb4aa064ff5a5b936730b53 (patch) | |
tree | e9a1883c3b8f4bf86b4d5efe47b32c51b7e69f43 /test/unit/common/middleware | |
parent | 100d6b01bd40d8b01335e5ecd4a592df79e75b63 (diff) |
first gswauth functional tests
commiting first gswauth functional tests.
Currently there are two tests, to create account
and to create an user. Each test is self contained
in that it goes through the process of creating and deleting
accounts and users as needed.
More tests will be added shortly.
Change-Id: I26d577790aed8c79c9de11f224516423e9769962
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Reviewed-on: http://review.gluster.org/6188
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'test/unit/common/middleware')
-rw-r--r-- | test/unit/common/middleware/gswauth/swauth/test_middleware.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/unit/common/middleware/gswauth/swauth/test_middleware.py b/test/unit/common/middleware/gswauth/swauth/test_middleware.py index 6cd0b36..71c57ab 100644 --- a/test/unit/common/middleware/gswauth/swauth/test_middleware.py +++ b/test/unit/common/middleware/gswauth/swauth/test_middleware.py @@ -1180,7 +1180,7 @@ class TestAuth(unittest.TestCase): def test_prep_success(self): list_to_iter = [ - # PUT of .auth account + # PUT of gsmetadata account ('201 Created', {}, ''), # PUT of .account_id container ('201 Created', {}, '')] @@ -1266,7 +1266,7 @@ class TestAuth(unittest.TestCase): def test_prep_fail_account_create(self): self.test_auth.app = FakeApp(iter([ - # PUT of .auth account + # PUT of gsmetadata account ('503 Service Unavailable', {}, '')])) resp = Request.blank('/auth/v2/.prep', environ={ @@ -1281,7 +1281,7 @@ class TestAuth(unittest.TestCase): def test_prep_fail_token_container_create(self): self.test_auth.app = FakeApp(iter([ - # PUT of .auth account + # PUT of gsmetadata account ('201 Created', {}, ''), # PUT of .token container ('503 Service Unavailable', {}, '')])) @@ -1298,7 +1298,7 @@ class TestAuth(unittest.TestCase): def test_prep_fail_account_id_container_create(self): self.test_auth.app = FakeApp(iter([ - # PUT of .auth account + # PUT of gsmetadata account ('201 Created', {}, ''), # PUT of .token container ('201 Created', {}, ''), @@ -1317,13 +1317,13 @@ class TestAuth(unittest.TestCase): def test_get_reseller_success(self): self.test_auth.app = FakeApp(iter([ - # GET of .auth account (list containers) + # GET of gsmetadata account (list containers) ('200 Ok', {}, json.dumps([ {"name": ".token", "count": 0, "bytes": 0}, {"name": ".account_id", "count": 0, "bytes": 0}, {"name": "act", "count": 0, "bytes": 0}])), - # GET of .auth account (list containers + # GET of gsmetadata account (list containers # continuation) ('200 Ok', {}, '[]')])) resp = Request.blank('/auth/v2', @@ -1342,13 +1342,13 @@ class TestAuth(unittest.TestCase): ('200 Ok', {}, json.dumps({"groups": [{"name": "act:adm"}, {"name": "test"}, {"name": ".admin"}, {"name": ".reseller_admin"}], "auth": "plaintext:key"})), - # GET of .auth account (list containers) + # GET of gsmetadata account (list containers) ('200 Ok', {}, json.dumps([ {"name": ".token", "count": 0, "bytes": 0}, {"name": ".account_id", "count": 0, "bytes": 0}, {"name": "act", "count": 0, "bytes": 0}])), - # GET of .auth account (list containers + # GET of gsmetadata account (list containers # continuation) ('200 Ok', {}, '[]')])) resp = Request.blank('/auth/v2', @@ -1405,7 +1405,7 @@ class TestAuth(unittest.TestCase): def test_get_reseller_fail_listing(self): self.test_auth.app = FakeApp(iter([ - # GET of .auth account (list containers) + # GET of gsmetadata account (list containers) ('503 Service Unavailable', {}, '')])) resp = Request.blank('/auth/v2', headers={ @@ -1417,13 +1417,13 @@ class TestAuth(unittest.TestCase): self.assertEquals(self.test_auth.app.calls, 1) self.test_auth.app = FakeApp(iter([ - # GET of .auth account (list containers) + # GET of gsmetadata account (list containers) ('200 Ok', {}, json.dumps([ {"name": ".token", "count": 0, "bytes": 0}, {"name": ".account_id", "count": 0, "bytes": 0}, {"name": "act", "count": 0, "bytes": 0}])), - # GET of .auth account (list containers + # GET of gsmetadata account (list containers # continuation) ('503 Service Unavailable', {}, '')])) resp = Request.blank('/auth/v2', @@ -3858,7 +3858,7 @@ class TestAuth(unittest.TestCase): except Exception as err: exc = err self.assertEquals(str(exc), 'Could not get admin user object: ' - '/v1/AUTH_.auth/act/usr 503 Service Unavailable') + '/v1/AUTH_gsmetadata/act/usr 503 Service Unavailable') self.assertEquals(self.test_auth.app.calls, 1) def test_get_admin_detail_success(self): @@ -4079,7 +4079,7 @@ class TestAuth(unittest.TestCase): def test_reseller_admin_but_account_is_internal_use_only( self): - req = Request.blank('/v1/AUTH_.auth', + req = Request.blank('/v1/AUTH_gsmetadata', environ={'REQUEST_METHOD': 'GET'}) req.remote_user = 'act:usr,act,.reseller_admin' resp = self.test_auth.authorize(req) |