From 57b9f127287e50a77c643c37bca92825c9b4cebd Mon Sep 17 00:00:00 2001 From: Robert James Hernandez Date: Tue, 10 Sep 2024 13:38:05 +0000 Subject: [PATCH] nixos/scion: init scion ip gateway config in test create a scion-ip-gateway between scion04 and scion05 --- .../scion/freestanding-deployment/default.nix | 42 +++++++++++++++++++ .../freestanding-deployment/topology4.json | 6 +++ .../freestanding-deployment/topology5.json | 6 +++ 3 files changed, 54 insertions(+) diff --git a/nixos/tests/scion/freestanding-deployment/default.nix b/nixos/tests/scion/freestanding-deployment/default.nix index 90f4326affc1..55b2322ab02d 100644 --- a/nixos/tests/scion/freestanding-deployment/default.nix +++ b/nixos/tests/scion/freestanding-deployment/default.nix @@ -48,9 +48,47 @@ in }; scion04 = { ... }: { imports = (imports 4); + networking.interfaces."lo".ipv4.addresses = [{ address = "172.16.1.1"; prefixLength = 32; }]; + services.scion.scion-ip-gateway = { + enable = true; + config = { + tunnel = { + src_ipv4 = "172.16.1.1"; + }; + }; + trafficConfig = { + ASes = { + "42-ffaa:1:5" = { + Nets = [ + "172.16.100.0/24" + ]; + }; + }; + ConfigVersion = 9001; + }; + }; }; scion05 = { ... }: { imports = (imports 5); + networking.interfaces."lo".ipv4.addresses = [{ address = "172.16.100.1"; prefixLength = 32; }]; + services.scion.scion-ip-gateway = { + enable = true; + config = { + tunnel = { + src_ipv4 = "172.16.100.1"; + }; + }; + trafficConfig = { + ASes = { + "42-ffaa:1:4" = { + Nets = [ + "172.16.1.0/24" + ]; + }; + }; + ConfigVersion = 9001; + }; + }; }; }; testScript = let @@ -126,6 +164,10 @@ in # Execute pingAll command on all instances succeed("${pingAll} >&2") + # Execute ICMP pings across scion-ip-gateway + scion04.succeed("ping -c 3 172.16.100.1 >&2") + scion05.succeed("ping -c 3 172.16.1.1 >&2") + # Restart all scion services and ping again to test robustness succeed("systemctl restart scion-* >&2") succeed("${pingAll} >&2") diff --git a/nixos/tests/scion/freestanding-deployment/topology4.json b/nixos/tests/scion/freestanding-deployment/topology4.json index 03c507a4daf5..0526c1f1edd6 100644 --- a/nixos/tests/scion/freestanding-deployment/topology4.json +++ b/nixos/tests/scion/freestanding-deployment/topology4.json @@ -36,5 +36,11 @@ } } } + }, + "sigs": { + "sig-1": { + "ctrl_addr": "127.0.0.1:30256", + "data_addr": "127.0.0.1:30056" + } } } diff --git a/nixos/tests/scion/freestanding-deployment/topology5.json b/nixos/tests/scion/freestanding-deployment/topology5.json index 6114c1f73c2a..1326bd3c2955 100644 --- a/nixos/tests/scion/freestanding-deployment/topology5.json +++ b/nixos/tests/scion/freestanding-deployment/topology5.json @@ -36,5 +36,11 @@ } } } + }, + "sigs": { + "sig-1": { + "ctrl_addr": "127.0.0.1:30256", + "data_addr": "127.0.0.1:30056" + } } }