2016-11-15 09:30:13 -05:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
# or more contributor license agreements. Licensed under the Elastic License;
|
|
|
|
# you may not use this file except in compliance with the Elastic License.
|
|
|
|
|
|
|
|
# This file is used to test the X-Pack package.
|
|
|
|
|
|
|
|
# WARNING: This testing file must be executed as root and can
|
|
|
|
# dramatically change your system. It removes the 'elasticsearch'
|
|
|
|
# user/group and also many directories. Do not execute this file
|
|
|
|
# unless you know exactly what you are doing.
|
|
|
|
|
|
|
|
load $BATS_UTILS/utils.bash
|
|
|
|
load $BATS_UTILS/tar.bash
|
|
|
|
load $BATS_UTILS/plugins.bash
|
2017-09-19 04:07:39 -04:00
|
|
|
load $BATS_UTILS/xpack.bash
|
2016-11-15 09:30:13 -05:00
|
|
|
|
|
|
|
setup() {
|
|
|
|
skip_not_tar_gz
|
|
|
|
export ESHOME=/tmp/elasticsearch
|
2018-04-26 09:58:41 -04:00
|
|
|
export PACKAGE_NAME="elasticsearch"
|
2016-11-15 09:30:13 -05:00
|
|
|
export_elasticsearch_paths
|
|
|
|
export ESPLUGIN_COMMAND_USER=elasticsearch
|
|
|
|
}
|
|
|
|
|
2018-02-23 11:03:17 -05:00
|
|
|
@test "[X-PACK] install default distribution" {
|
2016-11-15 09:30:13 -05:00
|
|
|
# Cleans everything for the 1st execution
|
|
|
|
clean_before_test
|
|
|
|
|
|
|
|
# Install the archive
|
|
|
|
install_archive
|
2018-05-29 14:06:14 -04:00
|
|
|
set_debug_logging
|
2016-11-15 09:30:13 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "[X-PACK] verify x-pack installation" {
|
2017-09-19 04:07:39 -04:00
|
|
|
verify_xpack_installation
|
2017-06-12 07:56:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "[X-PACK] verify croneval works" {
|
2018-04-11 11:27:16 -04:00
|
|
|
run $ESHOME/bin/elasticsearch-croneval "0 0 20 ? * MON-THU" -c 2
|
2017-06-12 07:56:26 -04:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ "$output" == *"Valid!"* ]] || {
|
|
|
|
echo "Expected output message to contain [Valid!] but found: $output"
|
|
|
|
false
|
|
|
|
}
|
|
|
|
}
|