1 import ./make-test-python.nix ({ lib, ... }: {
3 meta = with lib.maintainers; {
4 maintainers = [ veehaitch ];
8 virtualisation.vlans = [ 1 ];
12 firewall.enable = false;
13 interfaces.eth1.ipv4.addresses = [
14 { address = "192.168.1.1"; prefixLength = 24; }
20 virtualisation.vlans = [ 1 ];
24 firewall.enable = false;
25 interfaces.eth1.ipv4.addresses = [
26 { address = "192.168.1.2"; prefixLength = 24; }
34 node1.wait_for_unit("systemd-networkd-wait-online.service")
35 node2.wait_for_unit("systemd-networkd-wait-online.service")
37 with subtest("test RestrictNetworkInterfaces= works"):
38 node1.succeed("ping -c 5 192.168.1.2")
39 node1.succeed("systemd-run -t -p RestrictNetworkInterfaces='eth1' ping -c 5 192.168.1.2")
40 node1.fail("systemd-run -t -p RestrictNetworkInterfaces='lo' ping -c 5 192.168.1.2")