1 # This test makes sure that lxd stops implicitly depending on iptables when
2 # user enabled nftables.
4 # It has been extracted from `lxd.nix` for clarity, and because switching from
5 # iptables to nftables requires a full reboot, which is a bit hard inside NixOS
8 import ../make-test-python.nix (
11 name = "lxd-nftables";
21 firewall.enable = false;
22 nftables.enable = true;
23 nftables.tables."filter".family = "inet";
24 nftables.tables."filter".content = ''
26 type filter hook input priority 0;
31 type filter hook forward priority 0;
36 type filter hook output priority 0;
44 machine.wait_for_unit("network.target")
46 with subtest("When nftables are enabled, lxd doesn't depend on iptables anymore"):
47 machine.succeed("lsmod | grep nf_tables")
48 machine.fail("lsmod | grep ip_tables")