about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2019-04-15 07:05:13 +0200
committerGitHub <noreply@github.com>2019-04-15 07:05:13 +0200
commite5724e8e664ebf731f86220fe6722e9678489f3a (patch)
tree88ee31a590772ccc60c21ab3356c652b3443229e /nixos/tests
parente367f9459dcc36e362ff4ddd11c70f6b76be5200 (diff)
parent13352f28d2b587a01c262cbee29678209c919e95 (diff)
downloadnixlib-e5724e8e664ebf731f86220fe6722e9678489f3a.tar
nixlib-e5724e8e664ebf731f86220fe6722e9678489f3a.tar.gz
nixlib-e5724e8e664ebf731f86220fe6722e9678489f3a.tar.bz2
nixlib-e5724e8e664ebf731f86220fe6722e9678489f3a.tar.lz
nixlib-e5724e8e664ebf731f86220fe6722e9678489f3a.tar.xz
nixlib-e5724e8e664ebf731f86220fe6722e9678489f3a.tar.zst
nixlib-e5724e8e664ebf731f86220fe6722e9678489f3a.zip
Merge pull request #59514 from basvandijk/elk-7.0.0
elk7: init at 7.0.0
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/elk.nix22
1 files changed, 18 insertions, 4 deletions
diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix
index a82e75799aeb..3b3fbd73dd5f 100644
--- a/nixos/tests/elk.nix
+++ b/nixos/tests/elk.nix
@@ -12,7 +12,9 @@ with pkgs.lib;
 let
   esUrl = "http://localhost:9200";
 
-  mkElkTest = name : elk : makeTest {
+  mkElkTest = name : elk :
+   let elasticsearchGe7 = builtins.compareVersions elk.elasticsearch.version "7" >= 0;
+   in makeTest {
     inherit name;
     meta = with pkgs.stdenv.lib.maintainers; {
       maintainers = [ eelco offline basvandijk ];
@@ -69,11 +71,11 @@ let
               kibana = {
                 enable = true;
                 package = elk.kibana;
-                elasticsearch.url = esUrl;
               };
 
               elasticsearch-curator = {
-                enable = true;
+                # The current version of curator (5.6) doesn't support elasticsearch >= 7.0.0.
+                enable = !elasticsearchGe7;
                 actionYAML = ''
                 ---
                 actions:
@@ -126,7 +128,7 @@ let
       # See if logstash messages arive in elasticsearch.
       $one->waitUntilSucceeds("curl --silent --show-error '${esUrl}/_search' -H 'Content-Type: application/json' -d '{\"query\" : { \"match\" : { \"message\" : \"flowers\"}}}' | jq .hits.total | grep -v 0");
       $one->waitUntilSucceeds("curl --silent --show-error '${esUrl}/_search' -H 'Content-Type: application/json' -d '{\"query\" : { \"match\" : { \"message\" : \"dragons\"}}}' | jq .hits.total | grep 0");
-
+    '' + optionalString (!elasticsearchGe7) ''
       # Test elasticsearch-curator.
       $one->systemctl("stop logstash");
       $one->systemctl("start elasticsearch-curator");
@@ -151,4 +153,16 @@ in mapAttrs mkElkTest {
       logstash      = pkgs.logstash6-oss;
       kibana        = pkgs.kibana6-oss;
     };
+  "ELK-7" =
+    if enableUnfree
+    then {
+      elasticsearch = pkgs.elasticsearch7;
+      logstash      = pkgs.logstash7;
+      kibana        = pkgs.kibana7;
+    }
+    else {
+      elasticsearch = pkgs.elasticsearch7-oss;
+      logstash      = pkgs.logstash7-oss;
+      kibana        = pkgs.kibana7-oss;
+    };
 }