registry tests: assert audit log metadata

This commit is contained in:
Jimmy Zelinskie 2017-05-16 17:05:31 -04:00
parent 7444055511
commit e2c25ce9bc

View file

@ -1015,6 +1015,8 @@ class RegistryTestsMixin(object):
self.assertEquals(1, len(logs))
self.assertEquals('push_repo', logs[0]['kind'])
self.assertEquals('public', logs[0]['metadata']['namespace'])
self.assertEquals('newrepo', logs[0]['metadata']['repo'])
self.assertEquals('public', logs[0]['performer']['name'])
# Pull the repository.
@ -1044,6 +1046,8 @@ class RegistryTestsMixin(object):
self.assertEquals(1, len(logs))
self.assertEquals('push_repo', logs[0]['kind'])
self.assertEquals('buynlarge', logs[0]['metadata']['namespace'])
self.assertEquals('newrepo', logs[0]['metadata']['repo'])
self.assertEquals('buynlarge+ownerbot', logs[0]['performer']['name'])
# Pull the repository.
@ -1055,6 +1059,8 @@ class RegistryTestsMixin(object):
self.assertEquals(2, len(logs))
self.assertEquals('pull_repo', logs[0]['kind'])
self.assertEquals('buynlarge', logs[0]['metadata']['namespace'])
self.assertEquals('newrepo', logs[0]['metadata']['repo'])
self.assertEquals('buynlarge+ownerbot', logs[0]['performer']['name'])
@ -1074,6 +1080,8 @@ class RegistryTestsMixin(object):
logs = result.json()['logs']
self.assertEquals('pull_repo', logs[0]['kind'])
self.assertEquals('devtable', logs[0]['metadata']['namespace'])
self.assertEquals('newrepo', logs[0]['metadata']['repo'])
self.assertEquals('my-new-token', logs[0]['metadata']['token'])
@ -1091,6 +1099,8 @@ class RegistryTestsMixin(object):
self.assertEquals(2, len(logs))
self.assertEquals('pull_repo', logs[0]['kind'])
self.assertEquals('devtable', logs[0]['metadata']['namespace'])
self.assertEquals('newrepo', logs[0]['metadata']['repo'])
self.assertEquals('devtable', logs[0]['performer']['name'])
self.assertEquals(1, logs[0]['metadata']['oauth_token_id'])