diff --git a/qa/ganeti-qa.py b/qa/ganeti-qa.py index d77a4f751f7b0e1f7ee82c005c4bafcc3853d46c..cb22862c204a58b55ed3408bd70312070b9336a2 100755 --- a/qa/ganeti-qa.py +++ b/qa/ganeti-qa.py @@ -298,6 +298,8 @@ def RunGroupRwTests(): RunTestIf("group-rwops", qa_group.TestGroupAddWithOptions) RunTestIf("group-rwops", qa_group.TestGroupModify) RunTestIf(["group-rwops", "rapi"], qa_rapi.TestRapiNodeGroups) + RunTestIf(["group-rwops", "tags"], qa_tags.TestGroupTags, + qa_group.GetDefaultGroup()) def RunExportImportTests(instance, pnode, snode): diff --git a/qa/qa_group.py b/qa/qa_group.py index 290f837a1829672dc657b1a4d8c344876cf592b2..e09c2f8a27370772e398d76963c9ed9ec1a4c0c3 100644 --- a/qa/qa_group.py +++ b/qa/qa_group.py @@ -33,12 +33,20 @@ import qa_utils from qa_utils import AssertCommand, AssertEqual, GetCommandOutput +def GetDefaultGroup(): + """Returns the default node group. + + """ + groups = qa_config.get("groups", {}) + return groups.get("group-with-nodes", constants.INITIAL_NODE_GROUP_NAME) + + def TestGroupAddRemoveRename(): """gnt-group add/remove/rename""" groups = qa_config.get("groups", {}) - existing_group_with_nodes = groups.get("group-with-nodes", - constants.INITIAL_NODE_GROUP_NAME) + existing_group_with_nodes = GetDefaultGroup() + group1, group2, group3 = groups.get("inexistent-groups", ["group1", "group2", "group3"])[:3] diff --git a/qa/qa_rapi.py b/qa/qa_rapi.py index 8232b935262cc3aaf3ef0b9741ce6779d28811e2..cdf454a44d6203e46d25f889822d55868558e78f 100644 --- a/qa/qa_rapi.py +++ b/qa/qa_rapi.py @@ -415,6 +415,8 @@ def TestTags(kind, name, tags): uri = "/2/nodes/%s/tags" % name elif kind == constants.TAG_INSTANCE: uri = "/2/instances/%s/tags" % name + elif kind == constants.TAG_NODEGROUP: + uri = "/2/groups/%s/tags" % name else: raise errors.ProgrammerError("Unknown tag kind") diff --git a/qa/qa_tags.py b/qa/qa_tags.py index 9e48696d616eab5afb007aab33e7385aefe6f3bf..a4350aa3e9afd425488613e012f65c047144014a 100644 --- a/qa/qa_tags.py +++ b/qa/qa_tags.py @@ -34,6 +34,7 @@ _KIND_TO_COMMAND = { constants.TAG_CLUSTER: "gnt-cluster", constants.TAG_NODE: "gnt-node", constants.TAG_INSTANCE: "gnt-instance", + constants.TAG_NODEGROUP: "gnt-group", } @@ -71,6 +72,11 @@ def TestNodeTags(node): _TestTags(constants.TAG_NODE, node["primary"]) +def TestGroupTags(group): + """gnt-group tags""" + _TestTags(constants.TAG_NODEGROUP, group) + + def TestInstanceTags(instance): """gnt-instance tags""" _TestTags(constants.TAG_INSTANCE, instance["name"])