Commit 6228acdf authored by Hrvoje Ribicic's avatar Hrvoje Ribicic
Browse files

Modify test to reflect RAPI operation changes



A rlib2 unittest tested for the wrong behaviour, and this patch changes
the inputs and expected values to account for this.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 2ee9171a
......@@ -1763,18 +1763,27 @@ class TestInstancesMultiAlloc(unittest.TestCase):
clfactory = _FakeClientFactory(_FakeClient)
data = {
"instances": [{
"instance_name": "bar",
"name": "bar",
"mode": "create",
"disks": [{"size": 1024}],
"disk_template": "plain",
"nics": [{}],
}, {
"instance_name": "foo",
"name": "foo",
"mode": "create",
"disks": [{"size": 1024}],
"disk_template": "drbd",
"nics": [{}],
}],
}
handler = _CreateHandler(rlib2.R_2_instances_multi_alloc, [], {}, data,
clfactory)
(body, _) = handler.GetPostOpInput()
self.assertTrue(compat.all([inst["OP_ID"] == handler.POST_OPCODE.OP_ID
for inst in body["instances"]]))
self.assertTrue(compat.all(
[isinstance(inst, opcodes.OpInstanceCreate) for inst in body["instances"]]
))
class TestPermissions(unittest.TestCase):
......
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