diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-02-11 18:01:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-11 18:01:19 +0000 |
commit | 15bfb025abc83035ac77b1c25f706a2e0085daa9 (patch) | |
tree | 26f5ba96debc2944aaa98026a3493badbff2ddca /nixos/tests | |
parent | cd4ded4f128132955f589dc7fc94317b93cc4fa2 (diff) | |
parent | 474df7ca084945acb65f60e50afe3bd44f06701e (diff) |
Merge master into staging-next
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/envoy.nix | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/nixos/tests/envoy.nix b/nixos/tests/envoy.nix index 9d2c32ce102f2..1e4bfe626398e 100644 --- a/nixos/tests/envoy.nix +++ b/nixos/tests/envoy.nix @@ -13,7 +13,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { socket_address = { protocol = "TCP"; address = "127.0.0.1"; - port_value = 9901; + port_value = 80; }; }; }; @@ -22,12 +22,33 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { clusters = []; }; }; + specialisation = { + withoutConfigValidation.configuration = { ... }: { + services.envoy = { + requireValidConfig = false; + settings.admin.access_log_path = lib.mkForce "/var/log/envoy/access.log"; + }; + }; + }; }; - testScript = '' - machine.start() - machine.wait_for_unit("envoy.service") - machine.wait_for_open_port(9901) - machine.wait_until_succeeds("curl -fsS localhost:9901/ready") - ''; + testScript = { nodes, ... }: + let + specialisations = "${nodes.machine.system.build.toplevel}/specialisation"; + in + '' + machine.start() + + with subtest("envoy.service starts and responds with ready"): + machine.wait_for_unit("envoy.service") + machine.wait_for_open_port(80) + machine.wait_until_succeeds("curl -fsS localhost:80/ready") + + with subtest("envoy.service works with config path not available at eval time"): + machine.succeed('${specialisations}/withoutConfigValidation/bin/switch-to-configuration test') + machine.wait_for_unit("envoy.service") + machine.wait_for_open_port(80) + machine.wait_until_succeeds("curl -fsS localhost:80/ready") + machine.succeed('test -f /var/log/envoy/access.log') + ''; }) |