acceptance

Last updated: 2025-11-05 01:15:11.856671 File source: link on GitLab

NuNet Acceptance Tests

This document explains how to set up and run the NuNet acceptance tests, which currently use Incus, a Linux-native system for efficiently running and managing containers and virtual machines.

If you are a Mac users, see the section Using a Remote Incus Server.

1. Install Incus

Follow the official tutorial to install and initialize Incus: Install and initialize Incus

2. Initialize Incus Admin (after opening a new terminal session)

Until you restart, you need to run the following command every time you open a new terminal before running the tests:

2.1 Install QEMU for VM Support

To run Incus virtual machines, you must have QEMU installed.

For Ubuntu/Debian systems:

To verify QEMU is available:

If the above command returns a path (e.g., /usr/bin/qemu-system-x86_64), QEMU is properly installed.

Without QEMU, any attempt to launch Incus VMs will fail.

2.2 Optional: Check Incus Virtualization Support

To verify if Incus can manage VMs on your system, you can check:

You should see:

If you only see driver: lxc, then Incus is only supporting containers. This indicates missing VM support due to lack of QEMU or KVM.

3. Host Requirements for Running Incus Virtual Machines

To run virtual machines (VMs) with Incus, your system must support hardware virtualization (KVM). If you're running Incus inside another virtual machine (e.g., VirtualBox or a cloud VM), you must also enable nested virtualization.

3.1 Check if Your CPU Supports KVM

If the result is >=1, your processor supports hardware virtualization. vmx indicates Intel VT-x; svm indicates AMD-V.

3.2 Ensure KVM Modules Are Loaded

Expected output for Intel CPUs:

If the modules are not loaded, run:

3.3 Check If Nested Virtualization Is Enabled

For Intel:

For AMD:

If the output is Y, nested virtualization is enabled. If N, it is disabled.

3.4 Enable Nested Virtualization

Temporary (until reboot):

Permanent:

(Use kvm_amd instead of kvm_intel if you're on an AMD CPU.)

3.5 If Running Inside a Virtual Machine (e.g., VirtualBox)

Nested virtualization must also be enabled in the hypervisor.

From the host machine:

Or via VirtualBox GUI:

  1. Open VM settings

  2. Go to "System" > "Processor"

  3. Enable "Nested VT-x/AMD-V"

3.6 Verify Incus VM Support

To test launching a virtual machine:

4. Provision the required supporting infrastructure

The acceptance tests require Incus images to execute tests in Incus VMs or containers. To create these images locally, run from the root directory of the device-management-service project:

The acceptance tests require a GlusterFS Cluster to be provisioned in order to execute some tests related to the storage package.

To provision the infrastructure locally, first set DMS_ACC_TEST_CONFIG_FILE and then:

The script will rebuild DMS and launch the infrastructure using a dist file from dms built with the current branch and add the required information to the acceptance tests config file.

To reprovision the cluster without rebuilding DMS:

To deprovision the cluster:

4.1. Running infrastructure tests

There are independent tests for the infrastructure to assess basic functionality, which can work as a sanity check in case the acceptance tests fail.

To run these tests, change the config.yml file or copy it from confit.dist.yml and change the number of clients to 1, reprovision the infrastructure with make provision-acc-tests-infra, then execute:

5. Run the Acceptance Tests

From the root directory of the device-management-service project, execute to run acceptance tests using VMs (default):

To run acceptance tests using containers execute:

Docker and Incus may conflict if both are installed on the same machine. To fix this, run the following commands:

More information can be found in the official documentation: Prevent connectivity issues with Incus and Docker

6. Using a Remote Incus Server

NuNet acceptance tests run on an Incus server, which is primarily designed for Linux distributions. For Mac users, one viable approach is to use a pre-configured NuNet Incus server. Although Mac users can initiate the acceptance tests locally using the command make run-acceptance, the tests will actually be executed on the remote Incus server.

Follow these instructions to configure access to the Incus Server. Upon completing the setup, a config_out.yml file will be generated with the following structure:

Once you have the config_out.yml file, navigate to the device-management-service root directory and run the following commands to set the DMS_ACC_TEST_CONFIG_FILE variable and start the acceptance tests:

Last updated