From 602231132d7fcfddf037b3c166b720b8acf5fadb Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Thu, 29 Oct 2015 12:52:42 +0100 Subject: [PATCH] kvm: Add UnitTests for LibvirtUtilitiesHelper These were lacking, but this helper is used in various places inside the KVM code. Some simple tests to verify the helper is doing what we expect it to do. --- .../LibvirtCopyVolumeCommandWrapper.java | 2 +- ...ateTemplateFromSnapshotCommandWrapper.java | 2 +- .../wrapper/LibvirtUtilitiesHelper.java | 2 +- .../LibvirtComputingResourceTest.java | 18 +++--- .../wrapper/LibvirtUtilitiesHelperTest.java | 56 +++++++++++++++++++ .../java/com/cloud/utils/script/Script.java | 4 ++ 6 files changed, 72 insertions(+), 12 deletions(-) create mode 100644 plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtUtilitiesHelperTest.java diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtCopyVolumeCommandWrapper.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtCopyVolumeCommandWrapper.java index e6df5258067..b2248b99062 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtCopyVolumeCommandWrapper.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtCopyVolumeCommandWrapper.java @@ -66,7 +66,7 @@ public final class LibvirtCopyVolumeCommandWrapper extends CommandWrapper { return builder.toString(); } + public long getTimeout() { + return _timeout; + } + public String execute() { return execute(new OutputInterpreter.OutputLogger(_logger)); }