summary refs log tree commit diff
path: root/nixos/tests/corerad.nix
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2020-06-15 08:07:00 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2020-06-15 08:07:00 +0200
commit59dda0a42aa88005dab38cbdf1c39267431756a5 (patch)
treefc1635b48ef7c57623d7400ee6274cecc9da03dc /nixos/tests/corerad.nix
parent6857bccf12e1b55b75e22342368feef22c78d7b9 (diff)
parent9d0c3ffe6783d59b427d018e8341e0084737fde9 (diff)
downloadnixpkgs-59dda0a42aa88005dab38cbdf1c39267431756a5.tar
nixpkgs-59dda0a42aa88005dab38cbdf1c39267431756a5.tar.gz
nixpkgs-59dda0a42aa88005dab38cbdf1c39267431756a5.tar.bz2
nixpkgs-59dda0a42aa88005dab38cbdf1c39267431756a5.tar.lz
nixpkgs-59dda0a42aa88005dab38cbdf1c39267431756a5.tar.xz
nixpkgs-59dda0a42aa88005dab38cbdf1c39267431756a5.tar.zst
nixpkgs-59dda0a42aa88005dab38cbdf1c39267431756a5.zip
Merge master into staging-next
Diffstat (limited to 'nixos/tests/corerad.nix')
-rw-r--r--nixos/tests/corerad.nix35
1 files changed, 27 insertions, 8 deletions
diff --git a/nixos/tests/corerad.nix b/nixos/tests/corerad.nix
index 741fa448f68..72ab255b191 100644
--- a/nixos/tests/corerad.nix
+++ b/nixos/tests/corerad.nix
@@ -3,7 +3,7 @@ import ./make-test-python.nix (
     nodes = {
       router = {config, pkgs, ...}: { 
         config = {
-          # This machines simulates a router with IPv6 forwarding and a static IPv6 address.
+          # This machine simulates a router with IPv6 forwarding and a static IPv6 address.
           boot.kernel.sysctl = {
             "net.ipv6.conf.all.forwarding" = true;
           };
@@ -14,13 +14,25 @@ import ./make-test-python.nix (
             enable = true;
             # Serve router advertisements to the client machine with prefix information matching
             # any IPv6 /64 prefixes configured on this interface.
-            configFile = pkgs.writeText "corerad.toml" ''
-              [[interfaces]]
-              name = "eth1"
-              advertise = true
-                [[interfaces.prefix]]
-                prefix = "::/64"
-            '';
+            #
+            # This configuration is identical to the example in the CoreRAD NixOS module.
+            settings = {
+              interfaces = [
+                {
+                  name = "eth0";
+                  monitor = true;
+                }
+                {
+                  name = "eth1";
+                  advertise = true;
+                  prefix = [{ prefix = "::/64"; }];
+                }
+              ];
+              debug = {
+                address = "localhost:9430";
+                prometheus = true;
+              };
+            };
           };
         };
       };
@@ -66,5 +78,12 @@ import ./make-test-python.nix (
           assert (
               "/64 scope global temporary" in addrs
           ), "SLAAC temporary address was not configured on client after router advertisement"
+
+      with subtest("Verify HTTP debug server is configured"):
+          out = router.succeed("curl localhost:9430/metrics")
+
+          assert (
+              "corerad_build_info" in out
+          ), "Build info metric was not found in Prometheus output"
     '';
   })