From 3eeb38762a3ed56c7af9eeb15fc11ef76ddb3f1e Mon Sep 17 00:00:00 2001 From: Andy Bristol Date: Wed, 14 Feb 2018 19:40:51 -0800 Subject: [PATCH] [TEST] packaging: enable trial license x-pack used to generate a trial platinum license on startup, but now it generates a basic license. Configure security tests to use a trial license at startup Original commit: elastic/x-pack-elasticsearch@29382fe5ced3f6acf8c1bcc2f8a0bbaf03c8cafa --- .../resources/packaging/tests/bootstrap_password.bash | 3 ++- .../src/test/resources/packaging/tests/certgen.bash | 2 ++ .../test/resources/packaging/tests/setup_passwords.bash | 1 + qa/vagrant/src/test/resources/packaging/utils/xpack.bash | 8 ++++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash b/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash index 7c2a42c373b..b5b5d6b91ff 100644 --- a/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash +++ b/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash @@ -14,6 +14,7 @@ setup() { install install_xpack + generate_trial_license verify_xpack_installation fi } @@ -61,7 +62,7 @@ NEW_PASS } @test "[$GROUP] test bootstrap.password is in setting list" { - run sudo -E -u $DATA_USER sh <<"NODE_SETTINGS" + run sudo -E -u $ESPLUGIN_COMMAND_USER sh <<"NODE_SETTINGS" cat >> $ESCONFIG/elasticsearch.yml <<- EOF network.host: 127.0.0.1 http.port: 9200 diff --git a/qa/vagrant/src/test/resources/packaging/tests/certgen.bash b/qa/vagrant/src/test/resources/packaging/tests/certgen.bash index 313fbd97374..12d2797b9cb 100644 --- a/qa/vagrant/src/test/resources/packaging/tests/certgen.bash +++ b/qa/vagrant/src/test/resources/packaging/tests/certgen.bash @@ -91,6 +91,7 @@ install_node_using_archive() { export ESPLUGIN_COMMAND_USER=$DEFAULT_ARCHIVE_USER install_xpack + generate_trial_license verify_xpack_installation } @@ -118,6 +119,7 @@ install_node_using_package() { export ESPLUGIN_COMMAND_USER=$DEFAULT_PACKAGE_USER install_xpack + generate_trial_license verify_xpack_installation } diff --git a/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash b/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash index eac32fc04a0..050b8c2f225 100644 --- a/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash +++ b/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash @@ -14,6 +14,7 @@ setup() { install install_xpack + generate_trial_license verify_xpack_installation fi } diff --git a/qa/vagrant/src/test/resources/packaging/utils/xpack.bash b/qa/vagrant/src/test/resources/packaging/utils/xpack.bash index 435d60233a9..6d4839fe9d2 100644 --- a/qa/vagrant/src/test/resources/packaging/utils/xpack.bash +++ b/qa/vagrant/src/test/resources/packaging/utils/xpack.bash @@ -93,6 +93,14 @@ assert_number_of_files() { } } +generate_trial_license() { + sudo -E -u $ESPLUGIN_COMMAND_USER sh <<"NODE_SETTINGS" +cat >> $ESCONFIG/elasticsearch.yml <<- EOF +xpack.license.self_generated.type: trial +EOF +NODE_SETTINGS +} + wait_for_xpack() { local host=${1:-localhost} local port=${2:-9200}