Commit Graph

4095 Commits

Author SHA1 Message Date
Yannick Welsch 9d5ebe9e2a Use project-defined Java installation for keytool
Companion commit for elastic/elasticsearchelastic/elasticsearch#21540

Original commit: elastic/x-pack-elasticsearch@aa4e2df5bf
2016-11-14 15:43:11 +01:00
Nik Everett 6acde61347 Reenable testDynamicIndexSearchInput
It works this morning....

Original commit: elastic/x-pack-elasticsearch@5d9bb37df8
2016-11-11 10:19:06 -05:00
Spencer e21482adf6 Merge pull request elastic/elasticsearch#4049 from ycombinator/login-state-api
Don't expose license info on login page

Original commit: elastic/x-pack-elasticsearch@17aeefe294
2016-11-11 00:36:20 -07:00
Nik Everett ca3f13de69 Fix and disable some more tests
Template test is easy to fix. I have no idea what is up with the
dynamic index name test. It is finding results on the wrong time.

Original commit: elastic/x-pack-elasticsearch@535676164c
2016-11-10 22:20:08 -05:00
Nik Everett f15b8c94e4 Fix TemplateUtilsTests
The template has changed on disk so we have to change the assertion.

Original commit: elastic/x-pack-elasticsearch@cc9b76fcf6
2016-11-10 21:51:06 -05:00
Nik Everett 700467c3a7 Use index_patterns in templates
And skip a REST test that won't pass.

Original commit: elastic/x-pack-elasticsearch@e297add6c1
2016-11-10 21:42:59 -05:00
Jason Tedor 7da624739d Fix handler name on message not fully read
Today when a message is not fully read on a response, we log (among
other details) the handler name. Unfortunately, if the handler is a
wrapper, all that we see is

o.e.x.s.t.TransportService$ContextRestoreResponseHandler@7446ba18

completely losing the offending handler. This commit adds an override
for TransportService$ContextRestoreResponseHandler#toString so that the
underlying offender can be discovered.

Relates elastic/elasticsearch#4043

Original commit: elastic/x-pack-elasticsearch@3eb1003d5b
2016-11-10 16:13:23 -05:00
Jack Conradson 0977935989 Clean up of Script.
Closes elastic/elasticsearch#3982

Original commit: elastic/x-pack-elasticsearch@96c94ae8d5
2016-11-10 09:58:37 -08:00
Alexander Reelsen 2081399738 Watcher: Remove guice modules from codebase (elastic/elasticsearch#4030)
This removes all guice module classes from the watcher codebase, so that guice is
only used for the transport and rest actions, but nowhere else in the codebase.

Also it ensures, that only ticker/schedule are valid trigger engine options.

Original commit: elastic/x-pack-elasticsearch@400ba24c33
2016-11-10 10:46:20 +01:00
Alexander Reelsen 7f5216a112 Watcher: Remove unused watcher plugin version in index template (elastic/elasticsearch#4023)
There was an unused and unconverted xpack.watcher.plugin.version
in the watch history index template, which resulted in this template output:

```
 "watch_history_1" : {
    "order" : 2147483647,
    "template" : ".watcher-history-1*",
    "settings" : {
		... ,
        "xpack" : {
          "watcher" : {
            "plugin" : {
              "version" : "${xpack.watcher.plugin.version}"
            },
            "template" : {
              "version" : "1"
            }
          }
        }
      }
```

As everything is one plugin now, this can be safely removed.

Original commit: elastic/x-pack-elasticsearch@c5c0bcaaaa
2016-11-10 08:59:28 +01:00
Jay Modi 65db63cac4 Restore the original ThreadContext after a preserved context is restored
This change adds the restoration of the original context inside the listeners and handlers where
we restore another context. This prevents us from polluting the context of the thread that called
the listener and leaving around a different user in the thread context.


Original commit: elastic/x-pack-elasticsearch@0f30363ef7
2016-11-09 16:02:43 -05:00
Alexander Reelsen 743458705a Watcher: Deguice WatcherClientModule, HistoryModule & InputModule (elastic/elasticsearch#4024)
Original commit: elastic/x-pack-elasticsearch@202d94dd96
2016-11-09 16:16:24 +01:00
Alexander Reelsen b0dc931091 Watcher: Remove deprecated GeneralScriptException (elastic/elasticsearch#4012)
Also removes an unused exception method in the Exceptions class.

Original commit: elastic/x-pack-elasticsearch@72dea031bb
2016-11-09 09:44:30 +01:00
Alexander Reelsen 7d10100fcb Watcher: Remove version/versiontype support in get/delete watch (elastic/elasticsearch#3977)
As we are not dependent on any versions any more and we never exposed
an version type functionality, nor documented it nor tested it, we
should remove this for the next major release.

Note, this just removes the ability to set those options, which we ignored
anyway in the transport action.

Original commit: elastic/x-pack-elasticsearch@3830203f50
2016-11-08 19:09:09 +01:00
Alexander Reelsen fe460bba37 Watcher: Add AwaitsFix to ActivateWatchTests.testDeactivateAndActivate
Original commit: elastic/x-pack-elasticsearch@0e94e3993e
2016-11-08 18:57:33 +01:00
Yannick Welsch 1112a2e8b7 Fix for ClusterStateObserver changes in core
Companion commit for elastic/elasticsearchelastic/elasticsearch#21379

Original commit: elastic/x-pack-elasticsearch@b0011dcc9d
2016-11-08 15:15:48 +01:00
Alexander Reelsen 44cdec7c96 Watcher: Remove Validation/Error class for parsing (elastic/elasticsearch#3972)
Using Elasticsearch validation mechanism instead of having an own class

Original commit: elastic/x-pack-elasticsearch@999c9243cc
2016-11-08 09:54:22 +01:00
Ryan Ernst 7fc2ca6632 Merge pull request elastic/elasticsearch#4009 from rjernst/just_one_rest
Remove unneeded rest test params

Original commit: elastic/x-pack-elasticsearch@bc4f03685a
2016-11-07 15:08:29 -08:00
Ryan Ernst fa97a806ca Remove unneeded rest test params
This is the xplugins side of elastic/elasticsearchelastic/elasticsearch#21391

Original commit: elastic/x-pack-elasticsearch@30d36e340a
2016-11-07 14:46:39 -08:00
Areek Zillur 4a748498b5 Merge pull request elastic/elasticsearch#4006 from areek/fix/license-tool-zip
Ensure license-tools zip extracts to a parent directory

Original commit: elastic/x-pack-elasticsearch@aa0285f967
2016-11-07 16:01:59 -05:00
Areek Zillur fadd661738 Ensure license-tools zip extracts to a parent directory
Currently, extracting the license-tools zip does not create
a parent directory. This commit extracts out the `bin` and `lib`
folders inside a parent directory `license-tools-{version}`

Original commit: elastic/x-pack-elasticsearch@74960b6b1e
2016-11-07 15:47:52 -05:00
Alexander Reelsen bb94f3a2b2 Watcher: Refactor tests to ensure use of timewarp (elastic/elasticsearch#3973)
Ensure that tests never sleep, but run using timewarping,
so that sleeping can be removed from the test code.

Original commit: elastic/x-pack-elasticsearch@40fc3814f9
2016-11-07 14:33:57 +01:00
Jay Modi bd522191b2 test: use toJSON inside a role
This commit adds a test that uses toJSON templating inside of a role with
an array defined in the user's metadata.

Originates from user discussion at:
https://discuss.elastic.co/t/x-pack-security-role-definition-query-template-with-terms/62790

Original commit: elastic/x-pack-elasticsearch@196f7f597c
2016-11-07 07:21:41 -05:00
Alexander Reelsen ecb5bc89dc Watcher: Avoid NPE when local address is not resolvable (elastic/elasticsearch#3910)
This prevents a possible NPE when sending emails, as some host have
a perfectly fine internet connection, but cannot resolve their localhost.

In addition I also removed a EmailService.send() method that was only used
in tests and thus not needed.

Closes elastic/elasticsearch#3227

Original commit: elastic/x-pack-elasticsearch@d2e29b4c92
2016-11-07 11:55:50 +01:00
Alexander Reelsen 8b6552516e Watcher: Cleanup - remove Clock interface (elastic/elasticsearch#3985)
The clock interface is merely used to create mock clocks and inject them into tests.
We can do this with the java8 based java.time.Clock class as well, so there is no need
to keep this interface.

Original commit: elastic/x-pack-elasticsearch@ae30dc29ca
2016-11-07 09:10:25 +01:00
Jason Tedor 4e0457276d Start mock appender for capturing logger
The base test case class has been adapted to assert that no warn nor
error messages are logged to the Log4j status logger. An issue that
exists in x-pack uncovered by this change is that the mock appender in
the capturing logger was never started. This commit addresses this
issue.

Relates elastic/elasticsearch#3988

Original commit: elastic/x-pack-elasticsearch@8fc0b99bae
2016-11-04 14:21:28 -04:00
Nik Everett ae960f976d Slow down montiring bwc tests some more
Make them do things slightly less frequently and wait longer
to make sure everything is shut down. Sometimes it takes a while
but it does get there.

Original commit: elastic/x-pack-elasticsearch@76fc4acf47
2016-11-04 11:14:02 -04:00
jaymode 7cd3b8301b test: stop audit trails, increase logging and time to wait for it to start
See elastic/elasticsearch#3979

Original commit: elastic/x-pack-elasticsearch@79d559cb8f
2016-11-04 08:37:58 -04:00
Nik Everett 846b676127 Increase interval for monitoring bwc tests
Should make them more stable. Runs well locally.

Original commit: elastic/x-pack-elasticsearch@33b0dc3ae0
2016-11-03 21:52:47 -04:00
Nik Everett 3b11e764a9 Fix the monitoring bwc tests
This explicitly shuts down monitoring at the end of every index
which should help prevent the shutdown problems we were seeing.

Original commit: elastic/x-pack-elasticsearch@2be0ee0df8
2016-11-03 21:16:10 -04:00
Nik Everett 697a11ad02 Mark monitoring bwc indices tests awaitsfix
They have grown a bit unstable. I'll work to stabilize them
in the morning.

Original commit: elastic/x-pack-elasticsearch@e5f2fdcfb7
2016-11-03 18:33:27 -04:00
Nik Everett 784e40ac6c Slow down monitoring bwc test so it can shut down
We only need it to be so fast when starting up. We can slow it
down once it has started so shutdown isn't problematic.

Original commit: elastic/x-pack-elasticsearch@052d64402f
2016-11-03 17:33:30 -04:00
Chris Earle ac7b617f02 [Monitoring] Use Suffix with Marvel Index alias (elastic/elasticsearch#3961)
* [Monitoring] Use Suffix with Marvel Index alias

Using a suffix allows a non-aliased Monitoring index get created for _today_. Otherwise the time-based index for today cannot be created.

Original commit: elastic/x-pack-elasticsearch@92e7695a2c
2016-11-03 16:45:19 -04:00
Nik Everett 1926193766 Speed up and stabilize monitoring bwc tests
These tests were failing for me locally with this reproduction
line about 80% of the time:
```
gradle :x-plugins:elasticsearch:integTest -Dtests.seed=660D249EDCC648E5 -Dtests.class=org.elasticsearch.xpack.monitoring.OldMonitoringIndicesBackwardsCompatibilityIT -Dtests.method="testOldIndexes" -Dtests.security.manager=true -Dtests.jvms=12 -Dtests.locale=vi-VN -Dtests.timezone=Arctic/Longyearbyen
```

This was due to the ten second collection interval lining up with the
10 second sleep in `assertBusy`. Eventually the collection interval
lines up in such a way that it take more than ten seconds total to
create the alias for the monitoring index. 😢

This fixes that by dropping the interval to 100ms, making the test
no longer fail with that seed and succeed much more quickly. 😄

Relates to elastic/elasticsearch#3951

Original commit: elastic/x-pack-elasticsearch@b5dfa6ef7d
2016-11-03 15:46:57 -04:00
Areek Zillur a4e9f8f501 Merge pull request elastic/elasticsearch#3945 from areek/fix/license-cli-tools
Fix license command line tools

Original commit: elastic/x-pack-elasticsearch@bcc32c79a6
2016-11-03 12:03:28 -04:00
Ryan Ernst 230ebc9ff6 Merge pull request elastic/elasticsearch#3840 from rjernst/disco_zen_ping
x-plugins side of zen ping refactoring

Original commit: elastic/x-pack-elasticsearch@7767471a9a
2016-11-03 08:21:08 -07:00
Alexander Reelsen c0a1ec89f5 Tests: Improve execution speed of WatchStatsTests
Those tests ran 35 seconds on my local notebook. By not using a sleep based
scripting engine and some other tweaks the time is down to 13 seconds.

Also renamed the class to remove the `Slow` prefix.

Original commit: elastic/x-pack-elasticsearch@5289fe8dab
2016-11-03 14:27:01 +01:00
Jay Modi 714b891b03 security: add setting that makes system key required
This commit adds a setting that makes the system key required. If this setting is set to
true, a node will fail to startup when the system key does not exist.

Closes elastic/elasticsearch#3957

Original commit: elastic/x-pack-elasticsearch@e6d3000974
2016-11-03 07:54:38 -04:00
Nik Everett 1de85f4740 Move test for aliases starting with - into bwc
Moves the tests for aliases starting with `-` into the backwards
compatibility tests because we can no longer create such aliases.

Original commit: elastic/x-pack-elasticsearch@3639fe4d46
2016-11-02 19:53:36 -04:00
Chris Earle 7c8fc99098 [Monitoring UI] Show Replica Count not Replication Factor in Overview (elastic/elasticsearch#3949)
* [Monitoring UI] Show Replica Count not Replication Factor in Overview

This changes it to only show the replica count as `total - primaries` rather than showing the replication factor, which is particularly unhelpful when different indices have different replica counts.

Original commit: elastic/x-pack-elasticsearch@552f94bf8f
2016-11-02 16:24:42 -04:00
Nik Everett e63580459c Fix BWC index generation and tests for 5.0.0
Fixes the create_bwc_indexes script to build the bwc indices for
either 5.0.0 or 2.x.y.

Closes elastic/elasticsearch#3908

Original commit: elastic/x-pack-elasticsearch@f857647bb3
2016-11-02 14:52:04 -04:00
Alexander Reelsen 04969bd0cd Watcher: Remove ForceDeleteWatchTests
This test does not have a purpose anymore, since deletion of watches done
in elastic/elasticsearch#3481

Original commit: elastic/x-pack-elasticsearch@4bdf3614d3
2016-11-02 17:14:57 +01:00
Clinton Gormley 93fa60b601 Made REST spec param types consistent
duration -> time

Original commit: elastic/x-pack-elasticsearch@ca34bd2bdc
2016-11-02 15:30:09 +01:00
Luca Cavanna fae2f1a90f Security plugin to honour destructive operations setting (elastic/elasticsearch#3954)
`action.destructive_requires_name` setting was ignored by the security plugin as wildcards got expanded and resolved in the plugin before es core could actually check if the operation was supposed to be allowed or not. We are discussing how we could perform the check earlier in es core, but anyways it is good to perform the same check in the security plugin just to make sure.

Closes elastic/elasticsearch#3689

Original commit: elastic/x-pack-elasticsearch@3414cb3471
2016-11-02 15:01:25 +01:00
Alexander Reelsen 87ee1f30d6 Watcher: Make SchedulerEngine job handling threadsafe (elastic/elasticsearch#3955)
The old handling was not thread safe, as it used to replace volatile
objects in the code. This implementation uses a concurrent hashmap
to easily allow adding/removing schedules without having to replace
whole objects

Original commit: elastic/x-pack-elasticsearch@0aa618b372
2016-11-02 14:50:44 +01:00
Boaz Leskes 176829c4cc Change ClusterState and PendingClusterTasksResponse's toString() to their prettyPrint format (elastic/elasticsearch#3947)
Change ClusterState and PendingClusterTasksResponse's toString() to their prettyPrint format

Original commit: elastic/x-pack-elasticsearch@4ea9d56058
2016-11-02 13:44:09 +01:00
Alexander Reelsen fe93640e43 Watcher: Be strict with chain input parsing (elastic/elasticsearch#3873)
When parsing chain inputs there were possibilities to write invalid
JSON that resulting in losing the order of the inputs without any
exception being thrown.

This commit makes the parsing more strict.

Closes elastic/elasticsearch#3736

Original commit: elastic/x-pack-elasticsearch@963641ee2b
2016-11-02 10:37:41 +01:00
Alexander Reelsen 95e1f2942b Tests: Replaced bad apple test with REST test (elastic/elasticsearch#3920)
Original commit: elastic/x-pack-elasticsearch@5052f9cfbd
2016-11-02 09:58:38 +01:00
Adrien Grand 3e92b905c7 Improve QueryShardContext creation in SecurityIndexSearcherWrapper. (elastic/elasticsearch#3930)
Currently security always parses the permissions filters with a shard id equal
to `0` even if the query is executed on a different shard. Also it does not
protect against queries that may rely on the current timestamp even though we
don`t currently have ways to make sure that all shards use a consistent
timestamp.

Sibling of elastic/elasticsearchelastic/elasticsearch#21196.

Original commit: elastic/x-pack-elasticsearch@cab47f2ed2
2016-11-02 09:49:06 +01:00
Alexander Reelsen 043da7afe8 Tests: Remove bad apples from schedule engine tests (elastic/elasticsearch#3919)
The execution time of the trigger tests was extremely slow, because it
really waited until executions happened. This uses the mock clock to
advance in time manually.

This also allows to remove the bad apples annotation and make sure that
the schedule engine tests for both implementations are run all the time.

Relates elastic/elasticsearch#1007

Original commit: elastic/x-pack-elasticsearch@f9436f506f
2016-11-02 09:35:20 +01:00