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, ...} : {
11 meta = with pkgs.lib.maintainers; {
12 maintainers = [ patryk27 ];
15 nodes.machine = { lib, ... }: {
21 firewall.enable = false;
22 nftables.enable = true;
26 type filter hook input priority 0;
31 type filter hook forward priority 0;
36 type filter hook output priority 0;
45 machine.wait_for_unit("network.target")
47 with subtest("When nftables are enabled, lxd doesn't depend on iptables anymore"):
48 machine.succeed("lsmod | grep nf_tables")
49 machine.fail("lsmod | grep ip_tables")