The switch to compare-xml exhibits non intuitive behaviour in that
comparing without use of verbose mode does not detect documents that are
identical. The if statement allowed the tests to pass but reads that if
the documents compare as true then emit an error message and raise an
exception. However this is because it returns false even with the docs
are the same content. Unfortunately there was no pre-existing test
case added when
Since there were concerns about equivalent-xml not being active upstream
raised by a distribution maintainer, switching back should be avoided.
Attempted use of nokogiri-diff indicated that whitespace changes would
be treated as differences with it being unclear how to easily exclude.
Moving to xml-simple, which although will treat whitespace as
significant and even with NormaliseSpace set to disregard any whitespace
around content elements, it requires walking the returned structure to
remove the empty content attribute that is left behind to allow a direct
comparison between the data structures.
To ensure the XML comparison is validated add a test where libvirt
returns XML that is different to what was requested, and assert that
the expected error is raised, an error message emitted and that the
domain define would be reverted to the previous state if possible.
Relates-To: #1565Fixes: #1556
Using diffy alone is insufficient to spot when the XML returned by
libvirt for the changes applied is equivalent but formatted differently.
When libvirt returns slightly differently formatted XML corresponding to
what changes were actually applied, it can result in an error being
assumed to have happened when the update actually worked as expected.
Equivalent-xml handles detecting XML documents as being identical,
therefore switching to using it instead of diffy should produce more
reliable results, while retaining diffy for better formatted diffs
should an issue occur is useful.
Fixes: #1556
Fix a rather dumb error on my part where after checking the code
behaviour and then moving it to the driver, switched to using the
instance variable instead of the function. Because of this, on the first
usage the instance variable may not be populated, while the function
will correctly set up the connection.
Fixes: #1561
Add boot_order to the merge function to ensure that provider config
sections will persist the value if defined in earlier blocks. However to
ensure it is possible to override, definitions in latter sections will
replace the earlier definitions, but only if provided.
Fixes: #937
Request the list of physical devices from libvirt when performing
config validation. This ensures remote instances using bridges will get
the correct list of devices as well as be alerted when the device needed
does not exist.
Fixes issue introduced with #1499
For testing certain scenarios with vagrant-libvirt, need in the guest system a
value for the systems serial number in the DMI/SMBIOS system information.
The domain https://libvirt.org/formatdomain.html#smbios-system-information
format of libvirt allows to specify those values.
While adding `-smbios type=1,serial=$serial_value` to the `qemuargs` parameter
of the libvirt provider is already able to achieve this, a dedicated provider config
value adds native support from the `Vagrantfile` layering system. For example,
in the .box included Vagrantfile a random serial number can be enforced by
adding the following:
require 'securerandom'
Vagrant.configure("2") do |config|
config.vm.provider :libvirt do |libvirt|
libvirt.dmi_system_serial = SecureRandom.alphanumeric(8).upcase
end
end
Then in an instance specific Vagrantfile this value can be overwritten by adding:
Vagrant.configure("2") do |config|
config.vm.provider :libvirt do |libvirt|
libvirt.dmi_system_serial = "ABCDEFGH"
end
end
Co-authored-by: Nils Ballmann <nils.ballmann.ext@siemens.com>
Co-authored-by: Darragh Bailey <daragh.bailey@gmail.com>
Move to manage the entire plugin version menu and dependencies from the
same script. This will allow the entire site to roll forward to newer
releases and bugfix the plugin versions menu as issues are found, mostly
without needing to touch any of the individual releases.
Rework the links provided and menu styling to allow for a clear menu
edge, and a slight highlighting when hovering. Ensures that clicking
anywhere in the highlighted section should bring you to the selected
version.
Always use the same version of the plugin versions menu script, loading
from the latest across all releases. This is to allow for updates to
this component to be deployed across any release at the same time to
allow for a consistent switching experience.
Replace the select options for the plugin versions with one managed
purely using div tags and style primarily using JavaScript so the entire
menu can be managed from loading from a single script.
Retain a simple base style in the generated css file to facilitate
switching themes.
GitHub actions have changed behaviour subtly in that
now setting the env is no longer sufficient for the
following action to pick up automatically.
Instead switch to being explicit.
Avoid the need to parse the main version switching menu creation and
handling code by moving the site constants to a separate file.
Additionally move more of the element construction into the JavaScript
code to make it closer to a web component and facilitate more control by
a common script to be loaded by all published versions.
Switch from having all documentation contained within the README to
publishing a jekyll static site of documentation under github pages.
This allows for configuration and installation guides to be handled
separately to make for the relevant pieces to be in smaller chunks and
therefore easier to follow for users. Additionally a table of contents
can now be included in a left navigation section that ensures it should
be possible to quickly jump from the start to any section and back
again.
Include support for publishing previews and releases under separate
directories to allow for them to exist at the same time as the other
latest version of the documents.
The navigation section also includes support for accessing any of the
other versions published so that it easier to see what configuration
options exist for a given release. These will be published automatically
when releases are added.
Previous PR added tests but missed that the disk controller was not
being set correctly in the create domain action by default.
Update config documentation to include option.
For better performance allows enabling the virtio-scsi model on the
scsi controller in VM's.
Additionally supports inferring use of virtio-scsi model from disk
device or bus, and similarly infer the correct values for these
based on device or bus.
Currently one controller per 7 domain volume disks is created, this
follows virt-manager's behaviour, and is assumed a reasonable default.
However note that virtio-scsi should be capable of allowing many more
disks to be assigned per controller than this. It is presumed that the
source of the number 7 is allowing for 8 devices per controller
including the host adapter, which therefore allows for 7. Hardware SCSI
controllers typically supported 16 addressable devices including the
adapter providing for a 15 disk limit. Whether this is necessary is not
yet clear.
Co-authored-by: Darragh Bailey <daragh.bailey@gmail.com>
Move existing tests executed with the help of bats to use rspec directly
combined with tags to filter them out from being executed by default.
This allows for more complex assertions as well as easier debug as the
code supports use of setting 'VAGRANT_SPEC_SKIP_CLEANUP' to prevent the
tests from removing the temporary directory created for home and work
directories.
Extend a number of classes from vagrant-spec to override default
behaviour to allow passing of additional environment variables for
packaging tests, as well as supporting the skip cleanup. Given the use
of after to perform the cleanup, need to vendor the vagrant-spec
acceptance context in order to modify it easily.
If a box is added directly without a version, vagrant will default set
it to 0. When this occurs it is necessary to ensure use of mtime to
distinguish when the disk image in the box was last updated to allow
replacement of the box to trigger a fresh upload.
Fixes: #1382
As a starting point to help those with use of rvm and documentation for
development and contribution, ensure that some basic config to select a
ruby version and gemset to use is in placed.
Ensure that when no box is defined for a pxe install, that the domain
name is only populated for subsequent boots and if it is already
provided by a create action, skip attempting to retrieve from a
non-existing domain XML.
Fixes: #1508
Vagrant newer than 2.2.11 reworked how the after hook definition
functions requiring it to be called in a different way to ensure it is
possible to hook the box remove action to perform the expected local
action.
Add a compatibility function to ensure that the plugin works with both
mechanisms and some simple tests to ensure that with the unit tests
validated against the older vagrant versions that it confirms the action
will be called as expected.
As part of fixing the call of the remove_libvirt_image action, ensure it
only executes when the box removed is a libvirt one and ignores all
others.
Fixes: #1196
Basic tests for synced folder capabilities for 9p and virtiofs should
ensure consistent detection of files for coverage across multiple
versions of ruby as some versions pick up these files and others do not.
Detect when the device provided for connecting the VM to a public
network via the host does not exist and attempt to provide a useful
error message to give end users a hint of how to correct.
Fixes: #1477
Calling undefine on a domain and recreating it can result in some edge
case errors where if the current capabilities of libvirt have been
reduced, it may not be possible to restore the old definition.
Instead switch to calling `domain_define` with the new definition and
check that the resulting libvirt domain definition has been updated in
the expected manner, otherwise report an error to the user.
Fixes: #949
Relates-to: #1329
Relates-to: #1027
Relates-to: #1371