mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
nixos/tests/envoy: migrate to runTests
This commit is contained in:
parent
d237b5096b
commit
6ac38abf29
2 changed files with 57 additions and 56 deletions
|
@ -407,7 +407,10 @@ in
|
||||||
enlightenment = handleTest ./enlightenment.nix { };
|
enlightenment = handleTest ./enlightenment.nix { };
|
||||||
env = handleTest ./env.nix { };
|
env = handleTest ./env.nix { };
|
||||||
envfs = handleTest ./envfs.nix { };
|
envfs = handleTest ./envfs.nix { };
|
||||||
envoy = handleTest ./envoy.nix { };
|
envoy = runTest {
|
||||||
|
imports = [ ./envoy.nix ];
|
||||||
|
_module.args.envoyPackage = pkgs.envoy;
|
||||||
|
};
|
||||||
ergo = handleTest ./ergo.nix { };
|
ergo = handleTest ./ergo.nix { };
|
||||||
ergochat = handleTest ./ergochat.nix { };
|
ergochat = handleTest ./ergochat.nix { };
|
||||||
eris-server = handleTest ./eris-server.nix { };
|
eris-server = handleTest ./eris-server.nix { };
|
||||||
|
|
|
@ -1,62 +1,60 @@
|
||||||
import ./make-test-python.nix (
|
{ envoyPackage, lib, ... }:
|
||||||
{ pkgs, lib, ... }:
|
{
|
||||||
{
|
name = envoyPackage.pname;
|
||||||
name = "envoy";
|
|
||||||
meta = with pkgs.lib.maintainers; {
|
|
||||||
maintainers = [ cameronnemo ];
|
|
||||||
};
|
|
||||||
|
|
||||||
nodes.machine =
|
meta = with lib.maintainers; {
|
||||||
{ pkgs, ... }:
|
maintainers = [ cameronnemo ];
|
||||||
{
|
};
|
||||||
services.envoy.enable = true;
|
|
||||||
services.envoy.settings = {
|
nodes.machine = {
|
||||||
admin = {
|
services.envoy.enable = true;
|
||||||
access_log_path = "/dev/null";
|
services.envoy.package = envoyPackage;
|
||||||
address = {
|
services.envoy.settings = {
|
||||||
socket_address = {
|
admin = {
|
||||||
protocol = "TCP";
|
access_log_path = "/dev/null";
|
||||||
address = "127.0.0.1";
|
address = {
|
||||||
port_value = 80;
|
socket_address = {
|
||||||
};
|
protocol = "TCP";
|
||||||
};
|
address = "127.0.0.1";
|
||||||
|
port_value = 80;
|
||||||
};
|
};
|
||||||
static_resources = {
|
|
||||||
listeners = [ ];
|
|
||||||
clusters = [ ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
specialisation = {
|
|
||||||
withoutConfigValidation.configuration =
|
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
services.envoy = {
|
|
||||||
requireValidConfig = false;
|
|
||||||
settings.admin.access_log_path = lib.mkForce "/var/log/envoy/access.log";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
static_resources = {
|
||||||
|
listeners = [ ];
|
||||||
|
clusters = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
specialisation = {
|
||||||
|
withoutConfigValidation.configuration =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.envoy = {
|
||||||
|
requireValidConfig = false;
|
||||||
|
settings.admin.access_log_path = lib.mkForce "/var/log/envoy/access.log";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
testScript =
|
testScript =
|
||||||
{ nodes, ... }:
|
{ nodes, ... }:
|
||||||
let
|
let
|
||||||
specialisations = "${nodes.machine.system.build.toplevel}/specialisation";
|
specialisations = "${nodes.machine.system.build.toplevel}/specialisation";
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
machine.start()
|
machine.start()
|
||||||
|
|
||||||
with subtest("envoy.service starts and responds with ready"):
|
with subtest("envoy.service starts and responds with ready"):
|
||||||
machine.wait_for_unit("envoy.service")
|
machine.wait_for_unit("envoy.service")
|
||||||
machine.wait_for_open_port(80)
|
machine.wait_for_open_port(80)
|
||||||
machine.wait_until_succeeds("curl -fsS localhost:80/ready")
|
machine.wait_until_succeeds("curl -fsS localhost:80/ready")
|
||||||
|
|
||||||
with subtest("envoy.service works with config path not available at eval time"):
|
with subtest("envoy.service works with config path not available at eval time"):
|
||||||
machine.succeed('${specialisations}/withoutConfigValidation/bin/switch-to-configuration test')
|
machine.succeed('${specialisations}/withoutConfigValidation/bin/switch-to-configuration test')
|
||||||
machine.wait_for_unit("envoy.service")
|
machine.wait_for_unit("envoy.service")
|
||||||
machine.wait_for_open_port(80)
|
machine.wait_for_open_port(80)
|
||||||
machine.wait_until_succeeds("curl -fsS localhost:80/ready")
|
machine.wait_until_succeeds("curl -fsS localhost:80/ready")
|
||||||
machine.succeed('test -f /var/log/envoy/access.log')
|
machine.succeed('test -f /var/log/envoy/access.log')
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue