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 ({ pkgs, lib, ...} : {
11 nodes.machine = { lib, ... }: {
17 firewall.enable = false;
18 nftables.enable = true;
19 nftables.tables."filter".family = "inet";
20 nftables.tables."filter".content = ''
22 type filter hook input priority 0;
27 type filter hook forward priority 0;
32 type filter hook output priority 0;
40 machine.wait_for_unit("network.target")
42 with subtest("When nftables are enabled, lxd doesn't depend on iptables anymore"):
43 machine.succeed("lsmod | grep nf_tables")
44 machine.fail("lsmod | grep ip_tables")