about summary refs log tree commit diff
path: root/nixos/tests/fakeroute.nix
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2023-06-18 02:59:06 +0200
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-06-20 01:12:04 +0000
commit623d7d2124465e60a3f39f96e0299fa4c3c7b055 (patch)
tree596a11ba7420a192adf938f0f238ee7ba1304e49 /nixos/tests/fakeroute.nix
parent7d263715bdf3b05bc58b9ed4d5bea9b075ff0c70 (diff)
nixos/tests/fakeroute: init
Diffstat (limited to 'nixos/tests/fakeroute.nix')
-rw-r--r--nixos/tests/fakeroute.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/nixos/tests/fakeroute.nix b/nixos/tests/fakeroute.nix
new file mode 100644
index 0000000000000..37b174524ab81
--- /dev/null
+++ b/nixos/tests/fakeroute.nix
@@ -0,0 +1,22 @@
+import ./make-test-python.nix ({ lib, pkgs, ...} : {
+  name = "fakeroute";
+  meta.maintainers = with lib.maintainers; [ rnhmjoj ];
+
+  nodes.machine = { ... }: {
+    imports = [ ../modules/profiles/minimal.nix ];
+    services.fakeroute.enable = true;
+    services.fakeroute.route =
+      [ "216.102.187.130" "4.0.1.122"
+        "198.116.142.34" "63.199.8.242"
+      ];
+    environment.systemPackages = [ pkgs.traceroute ];
+  };
+
+  testScript =
+    ''
+      start_all()
+      machine.wait_for_unit("fakeroute.service")
+      machine.succeed("traceroute 127.0.0.1 | grep -q 216.102.187.130")
+    '';
+})
+