Skip to content

Commit

Permalink
docs/ioc: add section on KVM for integration test tutorial
Browse files Browse the repository at this point in the history
Nix will show an error running tests if KVM is not present.
  • Loading branch information
minijackson committed Jul 31, 2024
1 parent b46224c commit a0e3f8a
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/ioc/tutorials/integration-tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,50 @@ and checking that it behaves as expected.
This method of testing can then be automated
by running it inside a Continuous Integration (CI) system.

Pre-requisites
--------------

.. warning::
Nix assumes you can run hardware-accelerated VMs,
through KVM.

Make sure that you have KVM on your Linux machine
by checking if the file :file:`/dev/kvm` is present.

If the file is present,
you can proceed to the next section.

If you don't have KVM,
and you're running Nix on a physical machine,
examine your firmware settings
to see if you can enable hardware-accelerated virtualization.
The setting can show up as:

- Virtualization
- Intel Virtualization Technology
- Intel VT
- VT-d
- SVM Mode
- AMD-v

If you don't have KVM,
and you're running Nix on a virtual machine,
check your firmware settings
as said before,
and look up your hypervisor documentation
to enable nested virtualization.

If this doesn't work,
you can still proceed without hardware acceleration
by adding this line to your :file:`nix.conf`:

.. code-block::
:caption: :file:`/etc/nix/nix.conf`
extra-system-features = kvm
Note that this means much slower integration tests.

Writing the test
----------------

Expand Down

0 comments on commit a0e3f8a

Please sign in to comment.