3
0
Fork 0
forked from mirrors/nixpkgs

nixos/tests/nat: remove conntrack helpers test

Removed upstream
This commit is contained in:
K900 2023-03-04 10:50:38 +03:00
parent 18f85de76d
commit 84f3520c8f
2 changed files with 3 additions and 14 deletions

View file

@ -433,10 +433,8 @@ in {
nagios = handleTest ./nagios.nix {}; nagios = handleTest ./nagios.nix {};
nar-serve = handleTest ./nar-serve.nix {}; nar-serve = handleTest ./nar-serve.nix {};
nat.firewall = handleTest ./nat.nix { withFirewall = true; }; nat.firewall = handleTest ./nat.nix { withFirewall = true; };
nat.firewall-conntrack = handleTest ./nat.nix { withFirewall = true; withConntrackHelpers = true; };
nat.standalone = handleTest ./nat.nix { withFirewall = false; }; nat.standalone = handleTest ./nat.nix { withFirewall = false; };
nat.nftables.firewall = handleTest ./nat.nix { withFirewall = true; nftables = true; }; nat.nftables.firewall = handleTest ./nat.nix { withFirewall = true; nftables = true; };
nat.nftables.firewall-conntrack = handleTest ./nat.nix { withFirewall = true; withConntrackHelpers = true; nftables = true; };
nat.nftables.standalone = handleTest ./nat.nix { withFirewall = false; nftables = true; }; nat.nftables.standalone = handleTest ./nat.nix { withFirewall = false; nftables = true; };
nats = handleTest ./nats.nix {}; nats = handleTest ./nats.nix {};
navidrome = handleTest ./navidrome.nix {}; navidrome = handleTest ./navidrome.nix {};

View file

@ -3,7 +3,7 @@
# client on the inside network, a server on the outside network, and a # client on the inside network, a server on the outside network, and a
# router connected to both that performs Network Address Translation # router connected to both that performs Network Address Translation
# for the client. # for the client.
import ./make-test-python.nix ({ pkgs, lib, withFirewall, withConntrackHelpers ? false, nftables ? false, ... }: import ./make-test-python.nix ({ pkgs, lib, withFirewall, nftables ? false, ... }:
let let
unit = if nftables then "nftables" else (if withFirewall then "firewall" else "nat"); unit = if nftables then "nftables" else (if withFirewall then "firewall" else "nat");
@ -16,16 +16,11 @@ import ./make-test-python.nix ({ pkgs, lib, withFirewall, withConntrackHelpers ?
networking.nat.internalIPs = [ "192.168.1.0/24" ]; networking.nat.internalIPs = [ "192.168.1.0/24" ];
networking.nat.externalInterface = "eth1"; networking.nat.externalInterface = "eth1";
} }
(lib.optionalAttrs withConntrackHelpers {
networking.firewall.connectionTrackingModules = [ "ftp" ];
networking.firewall.autoLoadConntrackHelpers = true;
})
]; ];
in in
{ {
name = "nat" + (lib.optionalString nftables "Nftables") name = "nat" + (lib.optionalString nftables "Nftables")
+ (if withFirewall then "WithFirewall" else "Standalone") + (if withFirewall then "WithFirewall" else "Standalone");
+ (lib.optionalString withConntrackHelpers "withConntrackHelpers");
meta = with pkgs.lib.maintainers; { meta = with pkgs.lib.maintainers; {
maintainers = [ eelco rob ]; maintainers = [ eelco rob ];
}; };
@ -39,10 +34,6 @@ import ./make-test-python.nix ({ pkgs, lib, withFirewall, withConntrackHelpers ?
(pkgs.lib.head nodes.router.config.networking.interfaces.eth2.ipv4.addresses).address; (pkgs.lib.head nodes.router.config.networking.interfaces.eth2.ipv4.addresses).address;
networking.nftables.enable = nftables; networking.nftables.enable = nftables;
} }
(lib.optionalAttrs withConntrackHelpers {
networking.firewall.connectionTrackingModules = [ "ftp" ];
networking.firewall.autoLoadConntrackHelpers = true;
})
]; ];
router = router =
@ -95,7 +86,7 @@ import ./make-test-python.nix ({ pkgs, lib, withFirewall, withConntrackHelpers ?
client.succeed("curl -v ftp://server/foo.txt >&2") client.succeed("curl -v ftp://server/foo.txt >&2")
# Test whether active FTP works. # Test whether active FTP works.
client.${if withConntrackHelpers then "succeed" else "fail"}("curl -v -P - ftp://server/foo.txt >&2") client.fail("curl -v -P - ftp://server/foo.txt >&2")
# Test ICMP. # Test ICMP.
client.succeed("ping -c 1 router >&2") client.succeed("ping -c 1 router >&2")