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.
Switch to using explicit references to objects to be partially mocked
and remove the need to resolve the string constants as this will catch
more instances of calls to invalid or missing methods.
Rework how the vm is added to the machine for one of the tests as it is
not a method and instead is provided via internal state being exposed
with a helper.
Adjust the order of checks around use of qemu sessions to allow use of
the agent as a priority when enabled, which should remove the need to
retrieve the address from the system connection when enabled.
Additionally adjust the call to the agent to ensure it uses the default
connection to retrieve the correct domain, rather than forcing the
system connection, which will fail to find the domain if it was created
via a user session.
Add tests that validate most of this behaviour, as well as resulting in
some minor fixes around downcasing the mac address for comparisons, and
also using instance mocks with rspec instead of pure doubles to help
catch false positives where mocks are allowing calls that done exist.
Related: #1342
Various checks in the start domain action were accidentally causing a
redefine right after initial create. Update to provide debug output when
the domain needs to be changed to allow capture of the redefines
occurring in the future and to make it easy for the tests to pick up
where the redefine was triggered by setting an expectation on the log
output.
Include a small fix to avoid running strip on what might be a nil object
returned for elements without any text attributes.
Fix a bug where changes to tpm settings made to the config after an
initial domain creation where there was previously no tpm defined, would
be ignored.
Adds a logger double and updates other tests that trigger log calls.
should fix#1176
Add basic spec tests for the domain template to test rendering through
simple wrapping of a config object to provide values for class instance
variables used by the template as it mostly mirrors those required.
Reporting the MAC address being looked for in the ARP table should help
determine why some machines pick up an address belonging to another
when starting multiple VM's in parallel.
Add some basic spec tests for the WaitTillUp action class to lay some
foundations. Utilize vagrant-spec pinned to a known working commit for
tests to pass consistently until they provide releases.
Requires updating some of the rspec libraries and includes
sharedcontext.rb from the jantman/vagrant-r10k project on github.