Ensure forwarded ports are cleared on suspend and recreated on resume.
Included tests to exercise the entire up/start behaviour to ensure the
expected actions are called in various scenarios, moving config validate
to only occur at the entrypoints and dropping it from being called
during start. Also eliminate a duplicate SetupComplete call.
Fixes: #1115
Move the unit context to a name matching the other contexts. Remove some
unnecessary entries from it that are unused, and remove references to
the old name relying on spec helper to load all contexts.
Allowing synced folders to be validated as part of the action tests can
cause an excessive amount of time to be consumed due to many calls to
systemd and distro packager to check if nfs is available on the host.
Builds on the work started by @randomvariable in #840 addressing the comments
left there.
Fixes: #529
Signed-off-by: Rodolfo Olivieri rodolfo.olivieri3@gmail.com
Switch to instance doubles for driver where possible and reduce usage of
allow_any_instance_of.
Additionally replace some incorrect allows with expects to validate
calls are not made.
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