+ authority = get_authority(self.hrn)
+ auth_cred = self.client.GetCredential(authority, 'authority')
+ auth_record = {'hrn': '.'.join([authority, random_string(10).lower()]),
+ 'type': 'authority'}
+ node_record = {'hrn': '.'.join([authority, random_string(10)]),
+ 'type': 'node',
+ 'hostname': random_string(6) + '.' + random_string(6)}
+ slice_record = {'hrn': '.'.join([authority, random_string(10)]),
+ 'type': 'slice', 'researcher': [self.hrn]}
+ user_record = {'hrn': '.'.join([authority, random_string(10)]),
+ 'type': 'user',
+ 'email': random_string(6) +'@'+ random_string(5) +'.'+ random_string(3),
+ 'first_name': random_string(7),
+ 'last_name': random_string(7)}
+
+ all_records = [auth_record, node_record, slice_record, user_record]
+ for record in all_records:
+ try:
+ self.registry.Register(auth_cred, record)
+ self.registry.Resolve(self.credential, record['hrn'])
+ except:
+ raise
+ finally:
+ try: self.registry.Remove(auth_cred, record['type'], record['hrn'])
+ except: pass
+