wchisp: remove overuse of with lib (#357239)
[NixPkgs.git] / nixos / tests / opensearch.nix
blob7d37583464cb01ba0c8e0174a16f0d12e5c7218d
1 let
2   opensearchTest = extraSettings:
3     import ./make-test-python.nix (
4       { pkgs, lib, ... }: {
5         name = "opensearch";
6         meta.maintainers = with pkgs.lib.maintainers; [ shyim ];
8         nodes.machine = lib.mkMerge [
9           {
10             virtualisation.memorySize = 2048;
11             services.opensearch.enable = true;
12           }
13           extraSettings
14         ];
16         testScript = ''
17           machine.start()
18           machine.wait_for_unit("opensearch.service")
19           machine.wait_for_open_port(9200)
21           machine.succeed(
22               "curl --fail localhost:9200"
23           )
24         '';
25       });
28   opensearch = opensearchTest {};
29   opensearchCustomPathAndUser = opensearchTest {
30     services.opensearch.dataDir = "/var/opensearch_test";
31     services.opensearch.user = "open_search";
32     services.opensearch.group = "open_search";
33     systemd.tmpfiles.rules = [
34       "d /var/opensearch_test 0700 open_search open_search -"
35     ];
36     users = {
37       groups.open_search = { };
38       users.open_search = {
39         description = "OpenSearch daemon user";
40         group = "open_search";
41         isSystemUser = true;
42       };
43     };
44   };