> +def _TestEvac(filepath, filecontent, inst_move_type):
> + node1, node2 = qa_config.AcquireManyNodes(
> + 2,
> + exclude=qa_config.GetMasterNode())
> + inst = CreateInstanceDrbd8([node1, node2])
> + UploadData(node1.primary, filecontent, 0755, filepath)
> + pt = _GetMaintTags(node1)
> + AssertCommand(["gnt-cluster",
> + "modify",
> + "--diagnose-data-collector-filename",
> + os.path.basename(filepath)
> + ])
> + _AssertNodeDrained(node1)
> + _AssertInstanceMove(inst, inst_move_type)
> + _AssertRepairTagAddition(node1, pt)
> + AssertCommand(["gnt-node",
> + "modify",
> + "--drained=no",
> + node1.primary
> + ])
> + RemoveInstance(inst)
> + inst.Release()
> + node1.Release()
> + node2.Release()
This test does not clean up properly.
- the diagnose data collector is still set
- the repairready tag is left on the node
- the node is still drained.
Note that every QA test should either fail (and hence abort the QA) or
leave the whole cluster in the state it found it, to avoid influencing
other tests.
Also, for a maintd QA we should reduce the maintenance interval so that
the tests run reasonably fast; but don't forget to reset this afterwards.
> +
> +
> +def TestEvacuate():
> + """Test node evacuate upon diagnosis.
> +
> + """
> + AssertCommand(["gnt-cluster",
> + "modify",
> + "--maintenance-interval=3"
> + ])
> + n = random.randint(10000, 99999)
> + _TestEvac('/etc/ganeti/node-diagnose-commands/evacuate',
> + 'echo \'' + serializer.DumpJson({
> + "status": "evacuate",
> + "details": "qa evacuate test %d" % n}).strip() + '\'',
> + 'INSTANCE_MIGRATE')
--
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Matthew Scott Sucherman, Paul Terence Manicle