File 0003-Allow-the-connection.client.libversion-call-1416.patch of Package vagrant-libvirt

From a07889c9d23207e041144f525d410f53dd982061 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?=
 <45594031+dcermak@users.noreply.github.com>
Date: Fri, 3 Dec 2021 09:11:06 +0100
Subject: [PATCH 3/3] Allow the connection.client.libversion call (#1416)

When the tests are executed and rsync is not installed on the machine executing
the tests, then vagrant-libvirt will automatically fallback to virtiofs or
9p. Both of these perform the following call to check the libvirt version:

libvirt_version = machine.provider.driver.connection.client.libversion

However, this mock was not setup and thus those tests would fail.

This fixes https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1415

(cherry picked from commit 5914f0cffde072001f418aa04194408f2ea34aee)
---
 spec/unit/action_spec.rb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/spec/unit/action_spec.rb b/spec/unit/action_spec.rb
index 18e31fd..0eac063 100644
--- a/spec/unit/action_spec.rb
+++ b/spec/unit/action_spec.rb
@@ -27,6 +27,8 @@ describe VagrantPlugins::ProviderLibvirt::Action do
     allow(logger).to receive(:info)
     allow(logger).to receive(:debug)
     allow(logger).to receive(:error)
+
+    allow(connection.client).to receive(:libversion).and_return(6_002_000)
   end
 
   def allow_action_env_result(action, *responses)
-- 
2.31.1

openSUSE Build Service is sponsored by