Skip to content
Snippets Groups Projects
Commit fe508a9d authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

QA: Add tests for node group tags


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 414ebaf1
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
......@@ -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]
......
......@@ -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")
......
......@@ -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"])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment