+ def GetPlcRelease(self):
+ GetPlcRelease = self.debug(api.GetPlcRelease)
+ plc_release = GetPlcRelease(auth)
+
+ if self.config.verbose:
+ utils.header("GetPlcRelease")
+
+ def GetSliceKeys(self):
+ GetSliceKeys = self.debug(api.GetSliceKeys)
+ GetSlices = self.debug(api.GetSlices)
+
+ slices = GetSlices(auth, self.slice_ids)
+ if not slices: return 0
+ slices = filter(lambda s: s['person_ids'], slices)
+ if not slices: return 0
+ slice = slices[0]
+
+ slice_keys = GetSliceKeys(auth, [slice['slice_id']])
+ # XX Manually construct slice_keys for this slice and compare
+
+ if self.config.verbose:
+ utils.header("GetSliceKeys(%s)" % [slice['slice_id']])
+
+ def GetSliceTicket(self):
+ GetSliceTicket = self.debug(api.GetSliceTicket)
+
+ slice_id = random.sample(self.slice_ids, 1)[0]
+ slice_ticket = GetSliceTicket(auth, slice_id)
+
+ if self.config.verbose:
+ utils.header("GetSliceTicket(%s)" % slice_id)
+
+ def GetSlicesMD5(self):
+ GetSlicesMD5 = self.debug(api.GetSlicesMD5)
+
+ slices_md5 = GetSlicesMD5(auth)
+
+ if self.config.verbose:
+ utils.header("GetSlicesMD5")
+
+ def GetSlivers(self):
+ GetSlivers = self.debug(api.GetSlivers)
+ GetNodes = self.debug(api.GetNodes)
+ nodes = GetNodes(auth, self.node_ids)
+ if nodes is None or not nodes: return 0
+ nodes = filter(lambda n: n['slice_ids'], nodes)
+ if not nodes: return 0
+ node = nodes[0]
+
+ slivers = GetSlivers(auth, node['node_id'])
+
+ # XX manually create slivers object and compare
+
+ if self.config.verbose:
+ utils.header("GetSlivers(%s)" % node['node_id'])
+
+ def GetWhitelist(self):
+ GetWhitelist = self.debug(api.GetWhitelist)
+ GetNodes = self.debug(api.GetNodes)
+
+ whitelists = GetWhitelist(auth, self.node_ids)
+ nodes = GetNodes(auth, self.node_ids)
+ if nodes is None or not nodes: return 0
+ nodes = filter(lambda n: n['slice_ids_whitelist'], nodes)
+ self.islistequal(whitelists, nodes, 'GetWhitelist - isequal')
+
+ if self.config.verbose:
+ utils.header("GetWhitelist")
+
+ def NotifyPersons(self):
+ NotifyPersons = self.debug(api.NotifyPersons)
+ person_id = random.sample(self.person_ids, 1)[0]
+
+ NotifyPersons(auth, [person_id], 'QA Test', 'Welcome')
+
+ if self.config.verbose:
+ utils.header('NotifyPersons(%s)' % [person_id])
+
+ def NotifySupport(self):
+ NotifySupport = self.debug(api.NotifySupport)
+ NotifySupport(auth, 'QA Test', 'Support Request')
+
+ if self.config.verbose:
+ utils.header('NotifSupport')
+
+ def RebootNode(self):
+ RebootNode = self.debug(api.RebootNode)
+ node_id = random.sample(self.node_ids, 1)[0]
+ RebootNode(auth, node_id)
+
+ if self.config.verbose:
+ utils.header('RebootNode(%s)' % node_id)
+
+ def ResetPassword(self):
+ ResetPassword = self.debug(api.ResetPassword)
+ person_id = random.sample(self.person_ids, 1)[0]
+ ResetPassword(auth, person_id)
+
+ if self.config.verbose:
+ utils.header('ResetPassword(%s)' % person_id)
+
+ def SetPersonPrimarySite(self):
+ SetPersonPrimarySite = self.debug(api.SetPersonPrimarySite)
+ GetPersons = self.debug(api.GetPersons)
+ person_id = random.sample(self.person_ids, 1)[0]
+ persons = GetPersons(auth, person_id)
+ if not persons: return 0
+ person = persons[0]
+ site_id = random.sample(person['site_ids'], 1)[0]
+ SetPersonPrimarySite(auth, person_id, site_id)
+
+ if self.config.verbose:
+ utils.header('SetPersonPrimarySite(%s, %s)' % (person_id, site_id))
+
+ def VerifyPerson(self):
+ VerifyPerson = self.debug(api.VerifyPerson)
+ UpdatePerson = self.debug(api.UpdatePerson)
+ GetPersons = self.debug(api.GetPersons)
+
+ # can only verify new (disabled) accounts
+ person_id = random.sample(self.person_ids, 1)[0]
+ persons = GetPersons(auth, [person_id])
+ if persons is None or not persons: return 0
+ person = persons[0]
+ UpdatePerson(auth, person['person_id'], {'enabled': False})
+ VerifyPerson(auth, person['person_id'])
+
+ if self.config.verbose:
+ utils.header('VerifyPerson(%s)' % person_id)
+