On Fri, Dec 20, 2013 at 10:09 AM, Hrvoje Ribicic <[email protected]> wrote:
> This patch further extends the RAPI workload by exercising all the > group-related functionality. > > Signed-off-by: Hrvoje Ribicic <[email protected]> > --- > qa/rapi-workload.py | 56 > +++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 56 insertions(+) > > diff --git a/qa/rapi-workload.py b/qa/rapi-workload.py > index af7469c..9cd717b 100755 > --- a/qa/rapi-workload.py > +++ b/qa/rapi-workload.py > @@ -412,6 +412,58 @@ def TestNodeOperations(client, non_master_node): > MarkUnmarkNode(client, non_master_node, "offline") > > > +def TestGroupOperations(client, node, another_node): > + """ Tests various operations related to groups only. > + > + @type client C{GanetiRapiClientWrapper} > + @param client A Ganeti RAPI client to use. > + @type node string > + @param node The name of a node in the cluster. > + @type another_node string > + @param another_node The name of another node in the cluster. > colons :) > + > + """ > + > + DEFAULT_GROUP_NAME = constants.INITIAL_NODE_GROUP_NAME > + TEST_GROUP_NAME = "TestGroup" > + ALTERNATE_GROUP_NAME = "RenamedTestGroup" > + > + Finish(client, client.CreateGroup, > + TEST_GROUP_NAME, alloc_policy=constants.ALLOC_POLICY_PREFERRED, > + dry_run=True) > + > + Finish(client, client.CreateGroup, > + TEST_GROUP_NAME, alloc_policy=constants.ALLOC_POLICY_PREFERRED) > + > + client.GetGroup(TEST_GROUP_NAME) > + > + TestTags(client, client.GetGroupTags, client.AddGroupTags, > + client.DeleteGroupTags, TEST_GROUP_NAME) > + > + Finish(client, client.ModifyGroup, > + TEST_GROUP_NAME, alloc_policy=constants.ALLOC_POLICY_PREFERRED, > + depends=None) > + > + Finish(client, client.AssignGroupNodes, > + TEST_GROUP_NAME, [node, another_node], force=False, dry_run=True) > + > + Finish(client, client.AssignGroupNodes, > + TEST_GROUP_NAME, [another_node], force=False) > + > + Finish(client, client.RenameGroup, > + TEST_GROUP_NAME, ALTERNATE_GROUP_NAME) > + > + Finish(client, client.RenameGroup, > + ALTERNATE_GROUP_NAME, TEST_GROUP_NAME) > + > + Finish(client, client.AssignGroupNodes, > + DEFAULT_GROUP_NAME, [another_node], force=False) > + > + Finish(client, client.DeleteGroup, TEST_GROUP_NAME, dry_run=True) > + > + Finish(client, client.DeleteGroup, TEST_GROUP_NAME) > + > + > def Workload(client): > """ The actual RAPI workload used for tests. > > @@ -453,6 +505,10 @@ def Workload(client): > TestNodeOperations(client, node.primary) > node.Release() > > + nodes = qa_config.AcquireManyNodes(2) > + TestGroupOperations(client, nodes[0].primary, nodes[1].primary) > + qa_config.ReleaseManyNodes(nodes) > + > > def Usage(): > sys.stderr.write("Usage:\n\trapi-workload.py qa-config-file") > -- > 1.8.5.1 > > LGTM, thanks -- -- Helga Velroyen | Software Engineer | [email protected] | Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
