From f575206ad4348fb7fc0fe312a1e797bac23d011b Mon Sep 17 00:00:00 2001 From: wilderrodrigues Date: Fri, 8 May 2015 19:53:03 +0200 Subject: [PATCH] Fixing testModifySshKeysCommand in the LibvirtComputingResourceTest class - The test was okay, but when running in an environment where a /root/.ssh/id_rsa existed, it would return true then fail - We now mock the calls to methods that return the key paths, instead of relying in the static variables --- .../LibvirtModifySshKeysCommandWrapper.java | 27 ++++++++++++------- .../wrapper/LibvirtUtilitiesHelper.java | 13 +++++++++ .../LibvirtComputingResourceTest.java | 7 +++++ 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtModifySshKeysCommandWrapper.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtModifySshKeysCommandWrapper.java index d5943c5f034..1295e7d3e54 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtModifySshKeysCommandWrapper.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtModifySshKeysCommandWrapper.java @@ -38,21 +38,28 @@ public final class LibvirtModifySshKeysCommandWrapper extends CommandWrapper