From ff716504b07052739a49cd95e46ba4ae2f35676f Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski <2151333+piotrkwiecinski@users.noreply.github.com> Date: Sun, 30 Mar 2025 14:03:48 +0200 Subject: [PATCH] nixosTests.nginx-sso: migrate to runTest Part of #386873 --- nixos/tests/all-tests.nix | 2 +- nixos/tests/nginx-sso.nix | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index feac30e7f17e..762877861f15 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -810,7 +810,7 @@ in { nginx-proxyprotocol = runTest ./nginx-proxyprotocol/default.nix; nginx-pubhtml = runTest ./nginx-pubhtml.nix; nginx-redirectcode = runTest ./nginx-redirectcode.nix; - nginx-sso = handleTest ./nginx-sso.nix {}; + nginx-sso = runTest ./nginx-sso.nix; nginx-status-page = handleTest ./nginx-status-page.nix {}; nginx-tmpdir = handleTest ./nginx-tmpdir.nix {}; nginx-unix-socket = handleTest ./nginx-unix-socket.nix {}; diff --git a/nixos/tests/nginx-sso.nix b/nixos/tests/nginx-sso.nix index 946e68b5e9be..9926b61ae6a8 100644 --- a/nixos/tests/nginx-sso.nix +++ b/nixos/tests/nginx-sso.nix @@ -1,4 +1,5 @@ -import ./make-test-python.nix ({ pkgs, ... }: { +{ pkgs, ... }: +{ name = "nginx-sso"; meta = { maintainers = with pkgs.lib.maintainers; [ ambroisie ]; @@ -8,7 +9,10 @@ import ./make-test-python.nix ({ pkgs, ... }: { services.nginx.sso = { enable = true; configuration = { - listen = { addr = "127.0.0.1"; port = 8080; }; + listen = { + addr = "127.0.0.1"; + port = 8080; + }; providers.token.tokens = { myuser = { @@ -19,7 +23,12 @@ import ./make-test-python.nix ({ pkgs, ... }: { acl = { rule_sets = [ { - rules = [ { field = "x-application"; equals = "MyApp"; } ]; + rules = [ + { + field = "x-application"; + equals = "MyApp"; + } + ]; allow = [ "myuser" ]; } ]; @@ -47,4 +56,4 @@ import ./make-test-python.nix ({ pkgs, ... }: { "curl -sSf -H 'Authorization: Token MyToken' -H 'X-Application: MyApp' http://localhost:8080/auth" ) ''; -}) +}