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