Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Add fixture and test for ES plugin removal
Browse files Browse the repository at this point in the history
Plugin management code in Elasticsearch should work in union
filesystems as implemented by various Docker Storage Drivers.

Test that the x-pack plugin can be uninstalled correctly as part of
the acceptance tests.

Relates: elastic/elasticsearch#24231
  • Loading branch information
dliappis committed Apr 25, 2017
1 parent b6d7ec0 commit 262d1bc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/fixtures.py
Expand Up @@ -25,6 +25,9 @@ def __init__(self):
self.assert_healthy()
self.process = Process.get(comm='java')

# Retain a handle to the Command fixture letting us execute commands within the container(s)
self.command = Command

# Start each test with a clean slate.
assert self.load_index_template().status_code == codes.ok
assert self.delete().status_code == codes.ok
Expand Down Expand Up @@ -112,4 +115,15 @@ def assert_healthy(self):
assert self.get_node_count() == 2
assert self.get_cluster_status() == 'green'

def uninstall_plugin(self, plugin_name):
# This will run on only one host, but this is ok for the moment
# TODO: as per http://testinfra.readthedocs.io/en/latest/examples.html#test-docker-images
uninstall_output = self.command.run(' '.join(["bin/elasticsearch-plugin",
"-s",
"remove",
"{}".format(plugin_name)]))
# Reset elasticsearch to its original state
self.reset()
return uninstall_output

return Elasticsearch()
7 changes: 7 additions & 0 deletions tests/test_es_plugins.py
@@ -0,0 +1,7 @@
from .fixtures import elasticsearch
from requests import codes


def test_uninstall_xpack_plugin(elasticsearch):
# Ensure plugins can be uninstalled, see https://github.com/elastic/elasticsearch/issues/24231
assert elasticsearch.uninstall_plugin("x-pack").exit_status == 0

0 comments on commit 262d1bc

Please sign in to comment.