From ba8bb1d4a15fd5d26357ea0cc7c04b28645b50bf Mon Sep 17 00:00:00 2001 From: Andy Bristol Date: Tue, 29 May 2018 11:06:14 -0700 Subject: [PATCH] [test] packaging test logging for suse distros --- .../src/test/resources/packaging/tests/20_tar_package.bats | 1 + .../packaging/tests/module_and_plugin_test_cases.bash | 1 + qa/vagrant/src/test/resources/packaging/utils/utils.bash | 7 +++++++ .../src/test/resources/packaging/tests/10_basic.bats | 1 + .../test/resources/packaging/tests/bootstrap_password.bash | 1 + .../src/test/resources/packaging/tests/certgen.bash | 2 ++ .../test/resources/packaging/tests/setup_passwords.bash | 1 + 7 files changed, 14 insertions(+) diff --git a/qa/vagrant/src/test/resources/packaging/tests/20_tar_package.bats b/qa/vagrant/src/test/resources/packaging/tests/20_tar_package.bats index 1a3704c3317..3607e4ab45a 100644 --- a/qa/vagrant/src/test/resources/packaging/tests/20_tar_package.bats +++ b/qa/vagrant/src/test/resources/packaging/tests/20_tar_package.bats @@ -68,6 +68,7 @@ setup() { @test "[TAR] install archive" { # Install the archive install_archive + set_debug_logging count=$(find /tmp -type d -name 'elasticsearch*' | wc -l) [ "$count" -eq 1 ] diff --git a/qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash b/qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash index 79228adfee5..e258c4db5e6 100644 --- a/qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash +++ b/qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash @@ -61,6 +61,7 @@ setup() { [ ! -d "$ESHOME" ]; then clean_before_test install + set_debug_logging fi } diff --git a/qa/vagrant/src/test/resources/packaging/utils/utils.bash b/qa/vagrant/src/test/resources/packaging/utils/utils.bash index 4e3fdf5bd55..f8c3005de6c 100644 --- a/qa/vagrant/src/test/resources/packaging/utils/utils.bash +++ b/qa/vagrant/src/test/resources/packaging/utils/utils.bash @@ -461,6 +461,13 @@ debug_collect_logs() { describe_port 127.0.0.1 9201 } +set_debug_logging() { + if [ "$ESCONFIG" ] && [ -d "$ESCONFIG" ] && [ -f /etc/os-release ] && (grep -qi suse /etc/os-release); then + echo 'logger.org.elasticsearch.indices: DEBUG' >> "$ESCONFIG/elasticsearch.yml" + echo 'logger.org.elasticsearch.gateway: TRACE' >> "$ESCONFIG/elasticsearch.yml" + fi +} + # Waits for Elasticsearch to reach some status. # $1 - expected status - defaults to green wait_for_elasticsearch_status() { diff --git a/x-pack/qa/vagrant/src/test/resources/packaging/tests/10_basic.bats b/x-pack/qa/vagrant/src/test/resources/packaging/tests/10_basic.bats index 898fedbff79..b3683b5dd15 100644 --- a/x-pack/qa/vagrant/src/test/resources/packaging/tests/10_basic.bats +++ b/x-pack/qa/vagrant/src/test/resources/packaging/tests/10_basic.bats @@ -30,6 +30,7 @@ setup() { # Install the archive install_archive + set_debug_logging } @test "[X-PACK] verify x-pack installation" { diff --git a/x-pack/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash b/x-pack/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash index 043a8911ac4..587b782541d 100644 --- a/x-pack/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash +++ b/x-pack/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash @@ -13,6 +13,7 @@ setup() { export PACKAGE_NAME="elasticsearch" clean_before_test install + set_debug_logging generate_trial_license verify_xpack_installation diff --git a/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash b/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash index d75f75b383a..21e4284b215 100644 --- a/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash +++ b/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash @@ -96,6 +96,7 @@ install_node_using_archive() { export_elasticsearch_paths install_archive + set_debug_logging verify_archive_installation export ESPLUGIN_COMMAND_USER=$DEFAULT_ARCHIVE_USER @@ -123,6 +124,7 @@ install_node_using_package() { export_elasticsearch_paths install_package + set_debug_logging verify_package_installation export ESPLUGIN_COMMAND_USER=$DEFAULT_PACKAGE_USER diff --git a/x-pack/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash b/x-pack/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash index c13a2951136..c33947c1ac9 100644 --- a/x-pack/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash +++ b/x-pack/qa/vagrant/src/test/resources/packaging/tests/setup_passwords.bash @@ -14,6 +14,7 @@ setup() { export PACKAGE_NAME="elasticsearch" clean_before_test install + set_debug_logging generate_trial_license verify_xpack_installation