Commit Graph

266 Commits

Author SHA1 Message Date
Ryan Ernst 4ea19995cf Remove wildcard imports 2015-12-18 12:43:47 -08:00
Jack Conradson da5b07ae13 Added a new scripting language (PlanA).
Closes #15136
2015-12-09 16:32:37 -08:00
Robert Muir 784ebb1e1b fix bats tests 2015-12-04 03:25:43 -05:00
Ryan Ernst b8e462b934 Build: Change project attachment into special extra-plugins dir
Currently we use the "gradle project attachment plugin" to support
building elasticsearch as part of another project. However, this plugin
has a number of issues, a large part of which is requiring consistent
use of the projectsPrefix.

This change removes projectsPrefix, and adds support for a special
extra-plugins directory in the root of elasticsearch. Any projects
checked out within this directory will be automatically added to
elasticsearch.
2015-11-22 08:44:33 -08:00
Nik Everett 9b0a47d8e3 Fix rpm and deb distributions
and test them with vagrant
2015-11-18 14:16:42 -05:00
Ryan Ernst 634c495e3d Build: Use projectsPrefix in project references for vagrant tests
It is important we use projectsPrefix whenever addinga direct project
dependency, so that attachment still works.
2015-11-06 10:52:19 -08:00
Nik Everett 1dd00dddd5 [test] Gradle-ify vagrant tests
This gets the tar and tar_plugins tests working in gradle. It does so by
adding a subproject, qa/vagrant, which adds the following tasks:

Verification
------------
checkPackages - Check the packages against a representative sample of the
                linux distributions we have in our Vagrantfile
checkPackagesAllDistros - Check the packages against all the linux
                          distributions we have in our Vagrantfile

Package Verification
--------------------
checkCentos6 - Run packaging tests against centos-6
checkCentos7 - Run packaging tests against centos-7
checkDebian8 - Run packaging tests against debian-8
checkFedora22 - Run packaging tests against fedora-22
checkOel7 - Run packaging tests against oel-7
checkOpensuse13 - Run packaging tests against opensuse-13
checkSles12 - Run packaging tests against sles-12
checkUbuntu1204 - Run packaging tests against ubuntu-1204
checkUbuntu1404 - Run packaging tests against ubuntu-1404
checkUbuntu1504 - Run packaging tests against ubuntu-1504

Vagrant
-------
smokeTestCentos6 - Smoke test the centos-6 VM
smokeTestCentos7 - Smoke test the centos-7 VM
smokeTestDebian8 - Smoke test the debian-8 VM
smokeTestFedora22 - Smoke test the fedora-22 VM
smokeTestOel7 - Smoke test the oel-7 VM
smokeTestOpensuse13 - Smoke test the opensuse-13 VM
smokeTestSles12 - Smoke test the sles-12 VM
smokeTestUbuntu1204 - Smoke test the ubuntu-1204 VM
smokeTestUbuntu1404 - Smoke test the ubuntu-1404 VM
smokeTestUbuntu1504 - Smoke test the ubuntu-1504 VM
vagrantHaltCentos6 - Shutdown the vagrant VM running centos-6
vagrantHaltCentos7 - Shutdown the vagrant VM running centos-7
vagrantHaltDebian8 - Shutdown the vagrant VM running debian-8
vagrantHaltFedora22 - Shutdown the vagrant VM running fedora-22
vagrantHaltOel7 - Shutdown the vagrant VM running oel-7
vagrantHaltOpensuse13 - Shutdown the vagrant VM running opensuse-13
vagrantHaltSles12 - Shutdown the vagrant VM running sles-12
vagrantHaltUbuntu1204 - Shutdown the vagrant VM running ubuntu-1204
vagrantHaltUbuntu1404 - Shutdown the vagrant VM running ubuntu-1404
vagrantHaltUbuntu1504 - Shutdown the vagrant VM running ubuntu-1504
vagrantSmokeTest - Smoke test some representative distros from the Vagrantfile
vagrantSmokeTestAllDistros - Smoke test all distros from the Vagrantfile
vagrantUpCentos6 - Startup a vagrant VM running centos-6
vagrantUpCentos7 - Startup a vagrant VM running centos-7
vagrantUpDebian8 - Startup a vagrant VM running debian-8
vagrantUpFedora22 - Startup a vagrant VM running fedora-22
vagrantUpOel7 - Startup a vagrant VM running oel-7
vagrantUpOpensuse13 - Startup a vagrant VM running opensuse-13
vagrantUpSles12 - Startup a vagrant VM running sles-12
vagrantUpUbuntu1204 - Startup a vagrant VM running ubuntu-1204
vagrantUpUbuntu1404 - Startup a vagrant VM running ubuntu-1404
vagrantUpUbuntu1504 - Startup a vagrant VM running ubuntu-1504

It does not make the "check" task depend on "checkPackages" so running the
vagrant tests is still optional. They are slow and depend on vagrant and
virtualbox.

The Package Verification tasks are useful for testing individual distros.

The Vagrant tasks are listed in `gradle tasks` primarily for discoverability.
2015-11-05 14:28:30 -05:00
javanna 736823163f Plugins: plugin script to set proper plugin bin dir attributes
This commit makes sure that the plugin script looks at user, group and permissions of the elasticsearch bin dir and copies them over to the plugin bin subdirectory, whatever they are, so that they get properly setup depending on how elasticsearch was installed. We also make sure that execute permissions are added for files (we already did this before).

Relates to #11016
Closes #14088
2015-10-14 14:59:38 +02:00
javanna 4d7d29f65b Plugins: plugin script to set proper plugin config dir attributes
Depending on how elasticsearch is installed, we have two scenarios to take into account that relate to user, group and permissions assigned to the config directory:

1) deb/rpm package: /etc/elasticsearch is root:elasticsearch 750 and the plugin script is run from root user
2) tar/zip archive: es config dir is most likely elasticsearch:elasticsearch and the plugin script is most likely run from elasticsearch user

When the plugin script copies over the plugin config dir within the es config dir, it should take care of setting the proper user, group and permissions, which vary depending on how elasticsearch was installed in the first place. Should be root:elasticsearch 750 if installed from a package, or elasticsearch:elasticsearch if installed from an archive.

This commit makes sure that the plugin script looks at user, group and permissions of the config dir and copies them over to the plugin config subdirectory, whatever they are, so that they get properly setup depending on how elasticsearch was installed in the first place. We also make sure that execute permissions are left untouched for files.

Relates to #11016
Closes #14048
2015-10-13 15:56:26 +02:00
javanna 648cc6defa Packaging: change permissions/ownership of config dir
When generating the rpm and dep package we now set proper group (elasticsearch) and permissions (750) to the conf dir (default /etc/elasticsearch). Same for the scripts subdirectory.

Expanded the assert_file bash function to also optionally check the group of files, so we can actually test that the group was set correctly.

Relates to #11016
Closes #14017
2015-10-08 15:40:12 +02:00
David Pilato c73ab50df1 Rename cloud-gce plugin to discovery-gce plugin
Follow up azure and aws splits, we need to be consistent and rename `cloud-gce` to `discovery-gce`.
2015-10-08 06:53:37 +02:00
Britta Weber 2473e7499b name variables and don't always use the timeout 2015-10-06 20:37:44 +02:00
Britta Weber 71aefd5a06 remove option to configure custom config file via CONF_FILE or -Des.default.conf
It is rarely used and was not consistently handled by different distributions anyway.
This commit also adds a test for specifying CONF_DIR when installing plugins and
starting elasticsearch.

relates to #12712 and #12954
closes #5329
closes #13715
2015-10-06 19:02:43 +02:00
Britta Weber aa19a4134d vagrant tests: fix plugin outupt test
package installation creates the plugin directory already so when a plugin
is installed it prints the additional line
Plugins directory [/tmp/elasticsearch/plugins] does not exist. Creating...
2015-10-06 17:37:25 +02:00
Nik Everett e71bc472cc Merge pull request #13821 from nik9000/jayatana_test
Test that Jayatana is ignored
2015-10-06 09:14:28 -04:00
Britta Weber ed7c051586 Merge pull request #13861 from brwe/vagrant-install-groovy
install groovy plugin before running script test
2015-10-06 14:18:36 +02:00
Britta Weber 9492be65d4 plugin cli tool should not create empty log files
Plugin cli tools configures logging with whatever is in the logging.yml.
If a file appender is configured for any of the logs this will cause creation
of an empty log file. If a plugin was for example installed as root it will
create empty logs at es.home/logs.
This is problematic when for example plugins are installed as root and es is run
as service. Logs will then be created in /usr/share/elasticsearch/logs
and can later not be removed by for example dpkg -r or -purge.

To avoid this, configure the logger to use an appender that writes to the same
output that plugin cli tool does. This allows other components that are called
from Plugin cli tool to write to the same terminal that plugin cli tool writes to
by using the logging mechanism already in place.
The logging conf is not read at all pb plugin cli tool.

As a side effect, the loging level for components that are called
from the plugin command such as the jar hell check can now be configured
with -Des.logger.level which makes it easier to debug the jar hell check.
2015-10-06 14:13:24 +02:00
Britta Weber b4350e31be install groovy plugin before running script test
groovy moved to a plugin but the tests rely on it
see #13834
2015-10-05 00:23:48 +02:00
Britta Weber 1a67440989 add lang-groovy to plugin vagrant test 2015-09-29 17:56:29 +02:00
Robert Muir e0d42739dd Factor groovy out of core into lang-groovy 2015-09-28 20:17:45 -04:00
Nik Everett e45b2f7f0c [test] Jayatana is ignored
Installs javatana in vivid, emulates its on-login actions when starting
elasticsearch and verifies that elasticsearch turns off javatana.

Relates to #13813
2015-09-28 03:33:05 +02:00
Britta Weber d8ff91dbad [test] add lang-expression plugin to vagrant tests
we need this now that #13726 has been merged
2015-09-23 17:55:21 +02:00
Nik Everett 4d47015a0c Merge pull request #13579 from nik9000/run_plugin_as_elasticsearch_in_tar
Run bin/plugin as elasticsearch in tar distro
2015-09-22 11:19:19 -04:00
Nik Everett b521c606ff [test] Run bin/plugin as right user
Before this commit he tests always run bin/plugin as root which is somewhat
unrealistic and causes trouble (log files owned by root instead of
elasticsearch). After this commit `bin/plugin` runs as root when elasticsearch
is installed via the repository and as elasticsearch otherwise which is much
more realistic.

This also adds extra timeout to starting elasticsearch which is required
when all the plugins are installed. And it fixes up a problem with logging
elasticsearch's log if elasticsearch doesn't start which came up multiple
time while debugging this problem.

Also adds docs recommending running `bin/plugin` as the user that owns the
Elasticsearch files or root if installed with the packages.

Closes #13557
2015-09-22 11:17:57 -04:00
Alexander Reelsen 2b46a72a6c BATS testing: Add SLES-12 to list of tested virtual machines
This adds SuSe Linux Enterprise Server 12 to the list of tested VMs.
SLES 12 is using systemd, so that the current RPM works
out of the box.

SLES12 however is already quite old and does not ship with java8, so this
required adding an opensuse repo.
2015-09-22 15:02:22 +02:00
Nik Everett fe24bcaa39 [test] Fix plugin tests
Fix the vagrant tests after azure was split into 3 plugins. The tests
need to list all the plugins and some dependency so we can make sure the
plugin can be installed and uninstalled.
2015-09-21 15:47:37 -04:00
Nik Everett 1998c2ca4d Merge pull request #13633 from andrestc/plugins-script-check-java
Adds a validation for plugins script to check if java is set
2015-09-21 14:40:26 -04:00
David Pilato f230eabc15 [cloud-azure] Split azure plugin in 3 plugins
Until now we had a cloud-azure plugin which is providing 3 distinct features:

* discovery on Azure
* snapshot/restore on Aure
* SMB store

This commit splits the plugin by feature so people can use either one or the other or both features.

Doc is updated accordingly.
2015-09-21 17:55:23 +02:00
André Carvalho bb0b661d9b Fix script testing for centos-7 2015-09-20 00:28:25 -03:00
André Carvalho 0213aafaad Limits variable scope 2015-09-18 13:49:05 -03:00
André Carvalho ab1bd5db53 Adds test case for plugins script 2015-09-17 22:22:20 -03:00
André Carvalho 139a65770a Adds test case for elasticsearch script 2015-09-17 22:22:09 -03:00
Britta Weber c9cd70d419 [test] start elasticsearch and verify it does what it should after installing in custom dir 2015-09-17 17:24:13 +02:00
Britta Weber d4161ff938 [test] add test for 'plugin list'
Tests that the plugins that are reported with 'plugin list' are the
same as in the plugins pom.
2015-09-17 10:25:35 +02:00
Nik Everett 8d02efd088 [test] Packaging test for filesystem scripts
Adds a tests for loading scripts from the filesystem for search templates
and for search filters.

Closes #13184
2015-09-16 10:44:21 -04:00
Nik Everett 9257478b47 Merge pull request #13593 from nik9000/sles_vagrant
Add opensuse-13 to packaging tests
2015-09-16 10:12:31 -04:00
Nik Everett 058d385942 [test] Add opensuse-13 to packaging tests
This gets opensuse-13 working with vagrant and the packaging tests. They pass
with some minor tweaks.

Closes #13507
2015-09-16 10:09:39 -04:00
Nik Everett bfc5f47fe2 [test] Fix centos-6 tests
Right now we execute some debian-isms in the init.d tests. This switches to
trying both the debian and centos ways to stop services from starting
automatically.
2015-09-15 17:55:12 -04:00
Nik Everett 9c91af9b7f Merge pull request #13422 from nik9000/java_8_for_package_tests
Packaging tests use Java 8
2015-09-14 08:26:04 -04:00
Nik Everett 606896e4b6 [test] Packaging test for aws plugin's parts
The AWS plugin was broken into discovery-ec2 and repository-s3 so we can't
test the old plugin and must test the new ones.

Fixed some wording issues in test names.
2015-09-10 14:33:33 -04:00
Nik Everett afabdd1569 [test] Start with plugins in package tests
This changes the packaging tests to start Elasticsearch with all plugins
installed and checks `_cat/plugins?h=c` against the list of plugins in
the plugins directory. If the list differs, error! So it proves that the
plugins can be installed using bin/plugin as shipped in the rpm and deb
packages.

Closes #13254
2015-09-10 13:43:50 -04:00
Nik Everett 800fb5f7f5 [test] Document implementation choices
There are two other obvious ways to implement the "packages don't start
elasticsearch" checks but when you work through them they aren't as nice
as the implementation of the checks that we use now. This just adds
documentation to that effect.
2015-09-10 11:58:26 -04:00
Nik Everett 54e78b61b9 [test] Test that packages don't start service
We don't want either the deb or rpm package to start elasticsearch as soon
as they install nor do we want the package to register elasticsearch to
start on restart. That action is reserved for the administrator. This adds
tests for that.

Closes #13122
2015-09-10 11:58:26 -04:00
Nik Everett 4cabe39096 [test] Packaging tests use Java 8
To do this we:
1. All the rpm based distros we test support Java 8. We just ask to install
it.
2. There is a ppa that works for the Ubuntus. We just add that for them.
3. Debian Jessie has Java 8 in its backports. We just add that repository.
4. Debian Wheezy doesn't have Java 8 easily accessible so we drop it. We
could add it back with Orache Java 8 at a later date but that will take a
few more backflips and won't support things like vagrant-cachier.

This required a ton of rebuilding of vagrant boxes so it also fixes:
1. apt-get update is run too frequently
2. Lots of weird warning messages are spit out of apt-get
3. Switch from the chef provided based images to those provided by boxcutter.
The chef images has left vagrant atlas!

Closes #13366
2015-09-09 08:04:40 -04:00
Nik Everett 8d3df330ff [test] Add test for package reinstall after remove
Closes #13286
2015-09-07 09:07:07 -04:00
Nik Everett 72ea5327aa Merge pull request #13287 from nik9000/package_upgrade_test
Test upgrading from an older version
2015-09-04 15:35:36 -04:00
Nik Everett 04d254e571 [test] Documentation for packaging tests 2015-09-04 15:34:10 -04:00
Simon Willnauer 796701d52e Move version to 3.0.0-SNAPSHOT 2015-09-03 10:43:28 +02:00
Nik Everett ab5c981ed2 [test] Test upgrading from an older version
Adds a test for upgrading from 2.0.0-beta1 to the version of that is built.

Closes #13183
2015-09-02 15:16:53 -04:00
Nik Everett 38147da43e [tests] Fix exit code check for systemctl 2015-09-01 15:24:04 -04:00
Nik Everett 99d2f0463e [packaging] clean up more bats tests
This cleans up deb, rpm, systemd, and sysvinit tests:
1. Move skip_not_rpm, skip_not_dpkg, etc to the setup() methods for faster
runtime and cleaner code.
2. Removed lots of needless invocations of `run`
3. Created install_package for use in the systemd and sysvinit tests.
4. Removed lots of needless stderr to stdout redirects.

Closes #13075
Related to #13074
2015-09-01 14:57:47 -04:00
Nik Everett e4410482fe Packaging: Install all plugins during bats tests
Related to #12717
2015-09-01 13:43:56 -04:00
Nik Everett 23c1766cdc [packaging] Lock vagrant to virtualbox
Virtualbox is the default virtualization provier for vagrant but folks
override that from time to time. If they do then the build will fail because
the boxes used by the build don't usually support non-virtualbox providers.

Closes #13217
2015-08-31 10:45:46 -04:00
Nik Everett 577dcd7c26 Merge pull request #12903 from nik9000/cleanup_tar
Clean up the tar tests
2015-08-24 10:00:21 -04:00
David Pilato 0599f85d2d [build] simplify ant script for plugins
Now we are using short names for artifactId (see #12879) so we don't need anymore to transform long names `elasticsearch-pluginname` to short names `pluginname` in ant script when we install a plugin.
Modify also convert-plugin-name
Clean up remaining plugins with old format
And fix vagrant tests
2015-08-18 19:41:37 +02:00
Nik Everett 0b650ed203 Add tests for plugins with bin directory
Also removes all mention of shield:
```bash
$ find $BATS -type f -exec grep -Hi shield {} \;
$
```
2015-08-17 10:53:16 -07:00
Nik Everett 391ea379e2 Test: Use jvm-example for testing bin/plugin
Related to #12651
2015-08-17 10:53:16 -07:00
Nik Everett 513ac4471a Tests: Clean up the tar tests
1. Move `clean_before_test` to the first test so its more explicit.
2. Move `skip_not_tar_gz` to setup because it was run first in every test.
3. Remove calls to `run` that only check the status. Its simpler to just
execute the command. Its better because std-out will be captured and replayed
on error.
4. Switch from `su` to `sudo` because `su` was breaking `bats`'s error
reporting.
2015-08-17 10:31:08 -07:00
Nik Everett 708198ddd0 Merge pull request #12898 from nik9000/vagrant_name
Change qa/vagrant artifactId
2015-08-16 10:11:12 -07:00
Nik Everett 42300938aa Merge pull request #12904 from nik9000/remove_ES_CLEAN_BEFORE_TEST
Remove ES_CLEAN_BEFORE_TEST
2015-08-15 07:30:19 -07:00
Nik Everett 1d54cff167 Test: Remove ES_CLEAN_BEFORE_TEST
In the bats test ES_CLEAN_BEFORE_TEST was used to clean the environment
before running the tests. Unfortunately the tests don't work unless you
specify it every time. This removes that option and always runs the clean.
2015-08-14 15:12:52 -07:00
Simon Willnauer b447e2ae99 Move master to [2.1.0-SNAPSHOT] 2015-08-14 23:44:06 +02:00
Nik Everett 11d74dc26d Testing: Change qa/vagrant artifactId
Related to #12651
2015-08-14 13:18:23 -07:00
Simon Willnauer 605253a39f Cut over master to 2.0.0-SNAPSHOT 2015-08-12 21:16:08 +02:00
Nik Everett 999001746a Move vagrant activation to a parameter
Closes #12611
2015-08-12 07:40:09 -07:00
Nik Everett f84552dc98 [Packaging] Run tests in vagrant
This creates a module in qa called vagrant that can be run if you have
vagrant and virtualbox installed and will run the packaging tests in trusty
and centos-7.0. You can ask it to run tests in other linuxes. This is the full
list:
* precise aka Ubuntu 12.04
* trusty aka Ubuntu 14.04
* vivid aka Ubuntun 15.04
* wheezy aka Debian 7, the current debian oldstable distribution
* jessie aka Debian 8, the current debina stable distribution
* centos-6
* centos-7
* fedora-22
* oel-7

There is lots of documentation on how to do this in the TESTING.asciidoc.

Closes #12611
2015-08-10 05:31:42 -04:00