Commit ef7b75b2 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Merge remote branch 'origin/stable-2.1' into devel-2.1

* origin/stable-2.1:
  Fix bug introduced in commit 413b7472


  Fix locking bug causing high CPU usage
  Fix confd procotol design description
  Implement instance rename QA tests
  Fix "gnt-instance rename" functionality
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parents fabee4b2 b44b0141
......@@ -361,7 +361,7 @@ Wire protocol
A confd query will look like this, on the wire::
{
plj0{
"msg": "{\"type\": 1,
\"rsalt\": \"9aa6ce92-8336-11de-af38-001d093e835f\",
\"protocol\": 1,
......@@ -370,7 +370,10 @@ A confd query will look like this, on the wire::
"hmac": "4a4139b2c3c5921f7e439469a0a45ad200aead0f"
}
Detailed explanation of the various fields:
"plj0" is a fourcc that details the message content. It stands for plain
json 0, and can be changed as we move on to different type of protocols
(for example protocol buffers, or encrypted json). What follows is a
json encoded string, with the following fields:
- 'msg' contains a JSON-encoded query, its fields are:
......@@ -392,7 +395,7 @@ Detailed explanation of the various fields:
If an answer comes back (which is optional, since confd works over UDP)
it will be in this format::
{
plj0{
"msg": "{\"status\": 0,
\"answer\": 0,
\"serial\": 42,
......@@ -403,6 +406,7 @@ it will be in this format::
Where:
- 'plj0' the message type magic fourcc, as discussed above
- 'msg' contains a JSON-encoded answer, its fields are:
- 'protocol', integer, is the confd protocol version (initially just
......
......@@ -141,8 +141,12 @@ class _SingleNotifyPipeConditionWaiter(object):
while True:
remaining_time = running_timeout.Remaining()
if remaining_time is not None and remaining_time < 0.0:
break
if remaining_time is not None:
if remaining_time < 0.0:
break
# Our calculation uses seconds, poll() wants milliseconds
remaining_time *= 1000
try:
result = self._poller.poll(remaining_time)
......
......@@ -157,6 +157,11 @@ def RunCommonInstanceTests(instance):
if qa_config.TestEnabled('instance-reboot'):
RunTest(qa_instance.TestInstanceReboot, instance)
if qa_config.TestEnabled('instance-rename'):
RunTest(qa_instance.TestInstanceShutdown, instance)
RunTest(qa_instance.TestInstanceRename, instance)
RunTest(qa_instance.TestInstanceStartup, instance)
if qa_config.TestEnabled('tags'):
RunTest(qa_tags.TestInstanceTags, instance)
......
......@@ -62,17 +62,18 @@
"instance-add-plain-disk": true,
"instance-add-drbd-disk": true,
"instance-list": true,
"instance-automatic-restart": false,
"instance-consecutive-failures": false,
"instance-export": true,
"instance-failover": true,
"instance-import": true,
"instance-info": true,
"instance-list": true,
"instance-modify": true,
"instance-export": true,
"instance-import": true,
"instance-reinstall": true,
"instance-reboot": true,
"instance-reinstall": true,
"instance-rename": true,
"instance-shutdown": true,
"instance-automatic-restart": false,
"instance-consecutive-failures": false,
"# This test might fail with certain hypervisor types, depending": null,
"# on whether they support the `gnt-instance console' command.": null,
......
......@@ -127,6 +127,23 @@ def TestInstanceReinstall(instance):
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestInstanceRename(instance):
"""gnt-instance rename"""
master = qa_config.GetMasterNode()
rename_source = instance['name']
rename_target = qa_config.get('rename', None)
if rename_target is None:
print qa_utils.FormatError('"rename" entry is missing')
return
for name1, name2 in [(rename_source, rename_target),
(rename_target, rename_source)]:
cmd = ['gnt-instance', 'rename', name1, name2]
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestInstanceFailover(instance):
"""gnt-instance failover"""
master = qa_config.GetMasterNode()
......
......@@ -615,7 +615,7 @@ def RenameInstance(opts, args):
"""
op = opcodes.OpRenameInstance(instance_name=args[0],
new_name=args[1],
ignore_ip=opts.ignore_ip)
ignore_ip=not opts.ip_check)
SubmitOrSend(op, opts)
return 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment