On Fri, Dec 20, 2013 at 10:09 AM, Hrvoje Ribicic <[email protected]> wrote:
> The inter-cluster instance move test is very interesting for the RAPI > compatibility tests, as it uses many RAPI requests that are otherwise > hard to exercise. It uses no command-line functionality apart from > the standard QA instance checks. > > As the move-instance tool does its own checks of all the prerequisites > and desired results, not using the QA checks is acceptable for the RAPI > workload. This patch allows the checks to be skipped via an optional > argument. > > Signed-off-by: Hrvoje Ribicic <[email protected]> > --- > qa/qa_rapi.py | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/qa/qa_rapi.py b/qa/qa_rapi.py > index ea090d0..0c06e5c 100644 > --- a/qa/qa_rapi.py > +++ b/qa/qa_rapi.py > @@ -815,7 +815,7 @@ def GetOperatingSystems(): > > > def TestInterClusterInstanceMove(src_instance, dest_instance, > - inodes, tnode): > + inodes, tnode, perform_checks=True): > """Test tools/move-instance""" > master = qa_config.GetMasterNode() > > @@ -823,7 +823,9 @@ def TestInterClusterInstanceMove(src_instance, > dest_instance, > rapi_pw_file.write(_rapi_password) > rapi_pw_file.flush() > > - dest_instance.SetDiskTemplate(src_instance.disk_template) > + # Needed only if checks are to be performed > + if perform_checks: > + dest_instance.SetDiskTemplate(src_instance.disk_template) > > # TODO: Run some instance tests before moving back > > @@ -858,7 +860,14 @@ def TestInterClusterInstanceMove(src_instance, > dest_instance, > si, > ] > > - qa_utils.RunInstanceCheck(di, False) > + # Some uses of this test might require that RAPI-only commands are > used, > + # and the checks are command-line based. > + > + if perform_checks: > + qa_utils.RunInstanceCheck(di, False) > + > AssertEqual(StartLocalCommand(cmd).wait(), 0) > - qa_utils.RunInstanceCheck(si, False) > - qa_utils.RunInstanceCheck(di, True) > + > + if perform_checks: > + qa_utils.RunInstanceCheck(si, False) > + qa_utils.RunInstanceCheck(di, True) > I'd prefer more expressive variable names than 'si' and 'di'. > -- > 1.8.5.1 > > Rest LGTM, thanks -- -- Helga Velroyen | Software Engineer | [email protected] | Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
