From e1c90df4185a8b8e092153c714c6c55985d01bfd Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Thu, 22 Feb 2024 02:36:09 +0100 Subject: [PATCH] nixos/tests/vpp: init 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 --- nixos/tests/all-tests.nix | 1 + nixos/tests/vpp.nix | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 nixos/tests/vpp.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 8193c3dfe840f..d0c86843e1c83 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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 {}; diff --git a/nixos/tests/vpp.nix b/nixos/tests/vpp.nix new file mode 100644 index 0000000000000..b652dff2610ba --- /dev/null +++ b/nixos/tests/vpp.nix @@ -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") + ''; +})