mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-05 20:48:22 +00:00
Merge pull request #13617 from brwe/plugin-list-vagrant-test
[test] add test for 'plugin list'
This commit is contained in:
commit
07de30272b
@ -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" {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user