Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update packaging tests to work with meta plugins #28336

Merged
merged 2 commits into from
Jan 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions qa/vagrant/src/test/resources/packaging/utils/plugins.bash
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# specific language governing permissions and limitations
# under the License.

# Install a plugin an run all the common post installation tests.
# Install a plugin
install_plugin() {
local name=$1
local path="$2"
Expand All @@ -52,8 +52,6 @@ install_plugin() {
sudo -E -u $ESPLUGIN_COMMAND_USER bash -c "umask $umask && \"$ESHOME/bin/elasticsearch-plugin\" install -batch \"file://$path\""
fi

assert_file_exist "$ESPLUGINS/$name"
assert_file_exist "$ESPLUGINS/$name/plugin-descriptor.properties"
#check we did not accidentially create a log file as root as /usr/share/elasticsearch
assert_file_not_exist "/usr/share/elasticsearch/logs"

Expand All @@ -66,13 +64,6 @@ install_plugin() {
fi
}

install_jvm_plugin() {
local name=$1
local path="$2"
install_plugin $name "$path" $3
assert_file_exist "$ESPLUGINS/$name/$name"*".jar"
}

# Remove a plugin and make sure its plugin directory is removed.
remove_plugin() {
local name=$1
Expand All @@ -95,7 +86,7 @@ remove_plugin() {
# placements for non-site plugins.
install_jvm_example() {
local relativePath=${1:-$(readlink -m jvm-example-*.zip)}
install_jvm_plugin jvm-example "$relativePath" $2
install_plugin jvm-example "$relativePath" $2

bin_user=$(find "$ESHOME/bin" -maxdepth 0 -printf "%u")
bin_owner=$(find "$ESHOME/bin" -maxdepth 0 -printf "%g")
Expand Down Expand Up @@ -156,9 +147,11 @@ install_and_check_plugin() {
local full_name="$prefix-$name"
fi

install_jvm_plugin $full_name "$(readlink -m $full_name-*.zip)"
install_plugin $full_name "$(readlink -m $full_name-*.zip)"

assert_module_or_plugin_directory "$ESPLUGINS/$full_name"
assert_file_exist "$ESPLUGINS/$full_name/plugin-descriptor.properties"
assert_file_exist "$ESPLUGINS/$full_name/$full_name"*".jar"

# analysis plugins have a corresponding analyzers jar
if [ $prefix == 'analysis' ]; then
Expand All @@ -176,6 +169,17 @@ install_and_check_plugin() {
done
}

# Install a meta plugin
# $1 - the plugin name
# $@ - all remaining arguments are jars that must exist in the plugin's
# installation directory
install_meta_plugin() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where this is used. Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used in this pull request but we need it for our meta plugins and I think this is where it should be placed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

local name=$1

install_plugin $name "$(readlink -m $name-*.zip)"
assert_module_or_plugin_directory "$ESPLUGINS/$name"
}

# 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
Expand Down