2010/5/11 Iustin Pop <ius...@google.com>: > On Mon, May 10, 2010 at 05:30:42PM +0200, Michael Hanselmann wrote: >> + # Restore RAPI certificate >> cmd = ["gnt-cluster", "renew-crypto", "--force", >> - "--rapi-certificate=%s" % tmpcert] >> + "--rapi-certificate=%s" % rapi_cert_backup] >> AssertEqual(StartSSH(master["primary"], >> utils.ShellQuoteArgs(cmd)).wait(), 0) > > LGTM, but after this step, you don't verify that the correct file has > been put back into place, and this could trigger (seemingly unrelated) > RAPI failures (instead of renew-crypto failures). Are you fine with > that?
Since tests shouldn't call other tests (means we can't test the RAPI from here), it's a bit trickier. To ensure it's the same certificate, I modified the patch “RAPI QA: Use RAPI client” to retrieve the RAPI server's protocol version just after instantiating the client. If it succeeds before, it means we got the right certificate. Since the certificate isn't loaded again, the RAPI tests will fail if the certificate hasn't been restored properly. --- a/qa/qa_rapi.py +++ b/qa/qa_rapi.py @@ -73,6 +73,8 @@ def Setup(username, password): config_ssl_verification=cfg_ssl, ignore_proxy=True) + print "RAPI protocol version: %s" % _rapi_client.GetVersion() + INSTANCE_FIELDS = ("name", "os", "pnode", "snodes", "admin_state", Michael