From 2e8711a58820fa84b4a14c6b6e754a614f22bc0e Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 13 Nov 2022 21:21:00 +0100 Subject: use flakes --- tests/configuration.nix | 41 +++++++++++++++++++++++++++++++++++++++++ tests/run-tests.sh | 2 +- tests/vm.nix | 41 ----------------------------------------- 3 files changed, 42 insertions(+), 42 deletions(-) create mode 100644 tests/configuration.nix delete mode 100644 tests/vm.nix (limited to 'tests') diff --git a/tests/configuration.nix b/tests/configuration.nix new file mode 100644 index 0000000..e878c12 --- /dev/null +++ b/tests/configuration.nix @@ -0,0 +1,41 @@ +{ config, lib, ... }: + +let + nginxPorts = lib.concatLists + (lib.mapAttrsToList (_: cfg: (builtins.map (x: x.port) cfg.listen)) + config.services.nginx.virtualHosts); + nginxMakeLocal = port: { + listen = lib.mkForce [{ + inherit port; + addr = "0.0.0.0"; + }]; + forceSSL = lib.mkForce false; + enableACME = lib.mkForce false; + }; +in { + imports = [ ../configuration.nix ]; + + networking = lib.mkForce { + domain = "aristote.vm"; + + interfaces = { }; + defaultGateway = null; + nameservers = [ ]; + + firewall = { allowedTCPPorts = nginxPorts; }; + }; + + services.filtron.rules = lib.mkForce [ ]; + + services.nginx.virtualHosts = { + quentin = nginxMakeLocal 8080; + searx = nginxMakeLocal 8081; + money = nginxMakeLocal 8082; + rss = nginxMakeLocal 8083; + webkeydirectory = nginxMakeLocal 8084; + }; + + environment.etc."searx/secrets".text = '' + SECRET_KEY=secret_key + ''; +} diff --git a/tests/run-tests.sh b/tests/run-tests.sh index a55e282..b74a6fe 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -8,7 +8,7 @@ function cleanup { } sudo nixos-container stop hermes || exit 2 -sudo nixos-container update hermes --config-file ./vm.nix || exit 2 +sudo nixos-container update hermes --flake ..#hermes-test || exit 2 echo Starting container ... sudo nixos-container start hermes || exit 2 diff --git a/tests/vm.nix b/tests/vm.nix deleted file mode 100644 index e878c12..0000000 --- a/tests/vm.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ config, lib, ... }: - -let - nginxPorts = lib.concatLists - (lib.mapAttrsToList (_: cfg: (builtins.map (x: x.port) cfg.listen)) - config.services.nginx.virtualHosts); - nginxMakeLocal = port: { - listen = lib.mkForce [{ - inherit port; - addr = "0.0.0.0"; - }]; - forceSSL = lib.mkForce false; - enableACME = lib.mkForce false; - }; -in { - imports = [ ../configuration.nix ]; - - networking = lib.mkForce { - domain = "aristote.vm"; - - interfaces = { }; - defaultGateway = null; - nameservers = [ ]; - - firewall = { allowedTCPPorts = nginxPorts; }; - }; - - services.filtron.rules = lib.mkForce [ ]; - - services.nginx.virtualHosts = { - quentin = nginxMakeLocal 8080; - searx = nginxMakeLocal 8081; - money = nginxMakeLocal 8082; - rss = nginxMakeLocal 8083; - webkeydirectory = nginxMakeLocal 8084; - }; - - environment.etc."searx/secrets".text = '' - SECRET_KEY=secret_key - ''; -} -- cgit v1.2.3 From ab779a7476acc3a5b6dc350badd67f72f9402d6e Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 13 Nov 2022 21:55:15 +0100 Subject: remove hardware configuration from test config --- tests/configuration.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/configuration.nix b/tests/configuration.nix index e878c12..73c4bfa 100644 --- a/tests/configuration.nix +++ b/tests/configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, modulesPath, ... }: let nginxPorts = lib.concatLists @@ -15,6 +15,8 @@ let in { imports = [ ../configuration.nix ]; + boot.isContainer = true; + networking = lib.mkForce { domain = "aristote.vm"; -- cgit v1.2.3 From 2ceb13adc217d5e909f40b66c40d418d1b03d4fd Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 13 Nov 2022 22:58:15 +0100 Subject: tests: fix container update --- tests/run-tests.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/run-tests.sh b/tests/run-tests.sh index b74a6fe..92acdc8 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -7,7 +7,9 @@ function cleanup { sudo nixos-container stop hermes } +echo Stopping container for update ... sudo nixos-container stop hermes || exit 2 +echo Updating container ... sudo nixos-container update hermes --flake ..#hermes-test || exit 2 echo Starting container ... sudo nixos-container start hermes || exit 2 -- cgit v1.2.3 From 234e37175bedd061252a311cc3d08f4898132aae Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 13 Nov 2022 22:59:21 +0100 Subject: flake: interface modules and overlays --- tests/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/configuration.nix b/tests/configuration.nix index 73c4bfa..37b043c 100644 --- a/tests/configuration.nix +++ b/tests/configuration.nix @@ -13,7 +13,7 @@ let enableACME = lib.mkForce false; }; in { - imports = [ ../configuration.nix ]; + imports = [ ../config ]; boot.isContainer = true; -- cgit v1.2.3 From 4a24f168e3fb44073237d9aca95a97e77bdefa3c Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 27 Nov 2022 17:41:34 +0100 Subject: services: web: rss: make configuration into a module --- tests/configuration.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/configuration.nix b/tests/configuration.nix index 37b043c..a1ccf52 100644 --- a/tests/configuration.nix +++ b/tests/configuration.nix @@ -29,6 +29,8 @@ in { services.filtron.rules = lib.mkForce [ ]; + services.rss-bridge.debug = true; + services.nginx.virtualHosts = { quentin = nginxMakeLocal 8080; searx = nginxMakeLocal 8081; -- cgit v1.2.3 From 3362029ceb7076c9351ffac34133669faf661ac1 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 4 Dec 2022 13:11:10 +0100 Subject: services: web: searx: engines: update to v1.1.0 --- tests/run-tests.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'tests') diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 92acdc8..7842dc6 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -42,7 +42,6 @@ echo echo Checking custom Searx engines : declare -A QUERIES QUERIES[alternativeto]=Searx -QUERIES[emojipedia]='Thinking%20Face' QUERIES[nlab]='Kan%20extension' QUERIES[wikipediafr]=Paris QUERIES[wikipediaen]=Paris -- cgit v1.2.3 From 9bde3c4624eb916bafcf9a18792edb42e3a25a17 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Tue, 20 Dec 2022 22:29:23 +0100 Subject: searx: engines: wikipedia: fix xpath and test --- tests/run-tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 7842dc6..705f28d 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -43,8 +43,8 @@ echo Checking custom Searx engines : declare -A QUERIES QUERIES[alternativeto]=Searx QUERIES[nlab]='Kan%20extension' -QUERIES[wikipediafr]=Paris -QUERIES[wikipediaen]=Paris +QUERIES[wfr]=Paris +QUERIES[wen]=Paris for ENGINE in "${!QUERIES[@]}" do echo Checking engine $ENGINE ... -- cgit v1.2.3