1import ./make-test-python.nix ({ pkgs, lib, ... }: {
2 name = "containers-names";
3 meta = {
4 maintainers = with lib.maintainers; [ patryk27 ];
5 };
6
7 nodes.machine = { ... }: {
8 # We're using the newest kernel, so that we can test containers with long names.
9 # Please see https://github.com/NixOS/nixpkgs/issues/38509 for details.
10 boot.kernelPackages = pkgs.linuxPackages_latest;
11
12 containers = let
13 container = subnet: {
14 autoStart = true;
15 privateNetwork = true;
16 hostAddress = "192.168.${subnet}.1";
17 localAddress = "192.168.${subnet}.2";
18 config = { };
19 };
20
21 in {
22 first = container "1";
23 second = container "2";
24 really-long-name = container "3";
25 really-long-long-name-2 = container "4";
26 };
27 };
28
29 testScript = ''
30 machine.wait_for_unit("default.target")
31
32 machine.succeed("ip link show | grep ve-first")
33 machine.succeed("ip link show | grep ve-second")
34 machine.succeed("ip link show | grep ve-really-lFYWO")
35 machine.succeed("ip link show | grep ve-really-l3QgY")
36 '';
37})