Merge pull request #13617 from brwe/plugin-list-vagrant-test

[test] add test for 'plugin list'
This commit is contained in:
Britta Weber 2015-09-17 10:26:35 +02:00
commit 07de30272b
2 changed files with 18 additions and 6 deletions

View File

@ -197,17 +197,18 @@ fi
assert_file_exist "$ESHOME/plugins/site-example/_site/index.html"
}
@test "[$GROUP] check the installed plugins can be listed with 'plugins list' and result matches the list of plugins in plugins pom" {
"$ESHOME/bin/plugin" list | tail -n +2 | sed 's/^......//' > /tmp/installed
compare_plugins_list "/tmp/installed" "'plugins list'"
}
@test "[$GROUP] start elasticsearch with all plugins installed" {
start_elasticsearch_service
}
@test "[$GROUP] check the installed plugins matches the list of build plugins" {
curl -s localhost:9200/_cat/plugins?h=c | sed 's/ *$//' |
sort > /tmp/installed
ls /elasticsearch/plugins/*/pom.xml | cut -d '/' -f 4 |
sort > /tmp/expected
echo "Checking installed plugins (<) against the plugins directory (>):"
diff /tmp/installed /tmp/expected
curl -s localhost:9200/_cat/plugins?h=c | sed 's/ *$//' > /tmp/installed
compare_plugins_list "/tmp/installed" "_cat/plugins"
}
@test "[$GROUP] stop elasticsearch" {

View File

@ -107,3 +107,14 @@ install_and_check_plugin() {
assert_file_exist "$(readlink -m $ESPLUGINS/$fullName/$file)"
done
}
# Compare a list of plugin names to the plugins in the plugins pom and see if they are the same
# $1 the file containing the list of plugins we want to compare to
# $2 description of the source of the plugin list
compare_plugins_list() {
cat $1 | sort > /tmp/plugins
ls /elasticsearch/plugins/*/pom.xml | cut -d '/' -f 4 |
sort > /tmp/expected
echo "Checking plugins from $2 (<) against expected plugins (>):"
diff /tmp/expected /tmp/plugins
}