On Thu, Mar 14, 2013 at 12:52 PM, Klaus Aehlig <aeh...@google.com> wrote:
> Add a simple walk trhough the intended use case of Typo here: through > gnt-instance modify --new-primary for the disk template > file. The tested scenario is shuting down an instance, typo here: shutting > manually moving the disk to the new node, setting the > new primary, and starting up the instance on the new > node. It is also verified that the operation is rejected > while the instance is still running on the old node. > > Signed-off-by: Klaus Aehlig <aeh...@google.com> > --- > qa/ganeti-qa.py | 5 +++++ > qa/qa-sample.json | 1 + > qa/qa_instance.py | 33 +++++++++++++++++++++++++++++++++ > 3 files changed, 39 insertions(+) > > diff --git a/qa/ganeti-qa.py b/qa/ganeti-qa.py > index 6bdb690..88571aa 100755 > --- a/qa/ganeti-qa.py > +++ b/qa/ganeti-qa.py > @@ -601,6 +601,11 @@ def RunInstanceTests(): > instance, inodes) > RunTest(qa_instance.TestInstanceStartup, instance) > RunCommonInstanceTests(instance) > + if qa_config.TestEnabled("instance-modify-primary"): > + othernode = qa_config.AcquireNode() > + RunTest(qa_instance.TestInstanceModifyPrimaryAndBack, > + instance, inodes[0], othernode) > + othernode.Release() > RunGroupListTests() > RunExportImportTests(instance, inodes) > RunHardwareFailureTests(instance, inodes) > diff --git a/qa/qa-sample.json b/qa/qa-sample.json > index 0eb3b35..c072b1f 100644 > --- a/qa/qa-sample.json > +++ b/qa/qa-sample.json > @@ -184,6 +184,7 @@ > "instance-list": true, > "instance-migrate": true, > "instance-modify": true, > + "instance-modify-primary": true, > "instance-reboot": true, > "instance-reinstall": true, > "instance-rename": true, > diff --git a/qa/qa_instance.py b/qa/qa_instance.py > index 5692d93..062e7e3 100644 > --- a/qa/qa_instance.py > +++ b/qa/qa_instance.py > @@ -24,6 +24,7 @@ > """ > > import operator > +import os > import re > > from ganeti import utils > @@ -570,6 +571,38 @@ def TestInstanceModify(instance): > AssertCommand(["gnt-instance", "modify", "--online", instance.name]) > > > +@InstanceCheck(INST_UP, INST_UP, FIRST_ARG) > +def TestInstanceModifyPrimaryAndBack(instance, currentnode, othernode): > + """gnt-instance modify --new-primary > + > + This will leave the instance on its original primary node, not other node. > + > + """ > + if instance.disk_template != constants.DT_FILE: > + print qa_utils.FormatInfo("Test only supported for the file disk > template") > + return > + Won't this only work only if the whole qa is set to be file based? Should we change the qa to have qa-ed disk templates as a list, with most tests running on the first one listed, and any test which supports only some template run if that template is enabled? Thanks, Guido