Skip to content

Commit

Permalink
nixos/tests/vpp: init
Browse files Browse the repository at this point in the history
This is a very simple NixOS test to assert the fact that the VPP socket
is receiving commands as intended and works more or less.

In the future, this should properly be extended to real test exchanging packets
between a non-VPP system and a VPP system.

Signed-off-by: Raito Bezarius <[email protected]>
  • Loading branch information
RaitoBezarius committed Feb 22, 2024
1 parent 669cf96 commit e1c90df
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ in {
vscode-remote-ssh = handleTestOn ["x86_64-linux"] ./vscode-remote-ssh.nix {};
vscodium = discoverTests (import ./vscodium.nix);
vsftpd = handleTest ./vsftpd.nix {};
vpp = handleTest ./vpp.nix { };
warzone2100 = handleTest ./warzone2100.nix {};
wasabibackend = handleTest ./wasabibackend.nix {};
watchdogd = handleTest ./watchdogd.nix {};
Expand Down
38 changes: 38 additions & 0 deletions nixos/tests/vpp.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import ./make-test-python.nix ({ pkgs, lib, ... }:
{
name = "vpp";

meta = with pkgs.lib.maintainers; {
maintainers = [ raitobezarius ];
};

nodes = {
node = { ... }: {
# Clearly, VPP is hungry of hugepages…
virtualisation.memorySize = 4096;
services.vpp = {
enable = true;
configFile = pkgs.writeText "startup.conf" ''
unix {
nodaemon
nosyslog
full-coredump
cli-listen /run/vpp/cli.sock
}
api-trace {
on
}
'';
};
};
};

testScript = ''
start_all()
node.wait_for_unit("multi-user.target")
node.wait_for_unit("vpp.service")
node.succeed("vppctl show version | grep -i nixos")
node.succeed("vppctl show interface | grep -i local0")
'';
})

0 comments on commit e1c90df

Please sign in to comment.