diff --git a/src/dev/build/tasks/bin/scripts/kibana-encryption-keys b/src/dev/build/tasks/bin/scripts/kibana-encryption-keys index 5df19558214d3..0521ca1c39ce7 100755 --- a/src/dev/build/tasks/bin/scripts/kibana-encryption-keys +++ b/src/dev/build/tasks/bin/scripts/kibana-encryption-keys @@ -26,4 +26,4 @@ if [ -f "${CONFIG_DIR}/node.options" ]; then KBN_NODE_OPTS="$(grep -v ^# < ${CONFIG_DIR}/node.options | xargs)" fi -NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" "${NODE}" "${DIR}/src/cli_encryption_keys/dist" "$@" +NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production "${NODE}" "${DIR}/src/cli_encryption_keys/dist" "$@" diff --git a/src/dev/build/tasks/bin/scripts/kibana-encryption-keys.bat b/src/dev/build/tasks/bin/scripts/kibana-encryption-keys.bat index 1b065dd785d84..fdd3b2d88a5e9 100755 --- a/src/dev/build/tasks/bin/scripts/kibana-encryption-keys.bat +++ b/src/dev/build/tasks/bin/scripts/kibana-encryption-keys.bat @@ -6,6 +6,7 @@ set SCRIPT_DIR=%~dp0 for %%I in ("%SCRIPT_DIR%..") do set DIR=%%~dpfI set NODE=%DIR%\node\node.exe +set NODE_ENV=production If Not Exist "%NODE%" ( Echo unable to find usable node.js executable. diff --git a/src/dev/build/tasks/bin/scripts/kibana-keystore b/src/dev/build/tasks/bin/scripts/kibana-keystore index 9d2fd64c1c4eb..7f9986b519023 100755 --- a/src/dev/build/tasks/bin/scripts/kibana-keystore +++ b/src/dev/build/tasks/bin/scripts/kibana-keystore @@ -26,4 +26,4 @@ if [ -f "${CONFIG_DIR}/node.options" ]; then KBN_NODE_OPTS="$(grep -v ^# < ${CONFIG_DIR}/node.options | xargs)" fi -NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" "${NODE}" "${DIR}/src/cli_keystore/dist" "$@" +NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production "${NODE}" "${DIR}/src/cli_keystore/dist" "$@" diff --git a/src/dev/build/tasks/bin/scripts/kibana-keystore.bat b/src/dev/build/tasks/bin/scripts/kibana-keystore.bat index 11925dc4e70ed..bebfcfb156071 100755 --- a/src/dev/build/tasks/bin/scripts/kibana-keystore.bat +++ b/src/dev/build/tasks/bin/scripts/kibana-keystore.bat @@ -6,6 +6,7 @@ set SCRIPT_DIR=%~dp0 for %%I in ("%SCRIPT_DIR%..") do set DIR=%%~dpfI set NODE=%DIR%\node\node.exe +set NODE_ENV=production If Not Exist "%NODE%" ( Echo unable to find usable node.js executable. diff --git a/src/dev/build/tasks/bin/scripts/kibana-setup b/src/dev/build/tasks/bin/scripts/kibana-setup index 71f722f4af63f..db5ecd2db915c 100755 --- a/src/dev/build/tasks/bin/scripts/kibana-setup +++ b/src/dev/build/tasks/bin/scripts/kibana-setup @@ -26,4 +26,4 @@ if [ -f "${CONFIG_DIR}/node.options" ]; then KBN_NODE_OPTS="$(grep -v ^# < ${CONFIG_DIR}/node.options | xargs)" fi -NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" "${NODE}" "${DIR}/src/cli_setup/dist" "$@" +NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production "${NODE}" "${DIR}/src/cli_setup/dist" "$@" diff --git a/src/dev/build/tasks/bin/scripts/kibana-setup.bat b/src/dev/build/tasks/bin/scripts/kibana-setup.bat index df463a03ba050..5272e01230bd7 100755 --- a/src/dev/build/tasks/bin/scripts/kibana-setup.bat +++ b/src/dev/build/tasks/bin/scripts/kibana-setup.bat @@ -6,6 +6,7 @@ set SCRIPT_DIR=%~dp0 for %%I in ("%SCRIPT_DIR%..") do set DIR=%%~dpfI set NODE=%DIR%\node\node.exe +set NODE_ENV=production If Not Exist "%NODE%" ( Echo unable to find usable node.js executable. diff --git a/src/dev/build/tasks/bin/scripts/kibana-verification-code b/src/dev/build/tasks/bin/scripts/kibana-verification-code index e8214affc23d7..d64b05a571246 100755 --- a/src/dev/build/tasks/bin/scripts/kibana-verification-code +++ b/src/dev/build/tasks/bin/scripts/kibana-verification-code @@ -26,4 +26,4 @@ if [ -f "${CONFIG_DIR}/node.options" ]; then KBN_NODE_OPTS="$(grep -v ^# < ${CONFIG_DIR}/node.options | xargs)" fi -NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" "${NODE}" "${DIR}/src/cli_verification_code/dist" "$@" +NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production "${NODE}" "${DIR}/src/cli_verification_code/dist" "$@" diff --git a/src/dev/build/tasks/bin/scripts/kibana-verification-code.bat b/src/dev/build/tasks/bin/scripts/kibana-verification-code.bat index 9202244e951e4..930f19365e50b 100755 --- a/src/dev/build/tasks/bin/scripts/kibana-verification-code.bat +++ b/src/dev/build/tasks/bin/scripts/kibana-verification-code.bat @@ -6,6 +6,7 @@ set SCRIPT_DIR=%~dp0 for %%I in ("%SCRIPT_DIR%..") do set DIR=%%~dpfI set NODE=%DIR%\node\node.exe +set NODE_ENV=production If Not Exist "%NODE%" ( Echo unable to find usable node.js executable. diff --git a/src/dev/build/tasks/bin/scripts/kibana.bat b/src/dev/build/tasks/bin/scripts/kibana.bat index f3003b6427170..cef12793e879f 100755 --- a/src/dev/build/tasks/bin/scripts/kibana.bat +++ b/src/dev/build/tasks/bin/scripts/kibana.bat @@ -6,7 +6,6 @@ set SCRIPT_DIR=%~dp0 for %%I in ("%SCRIPT_DIR%..") do set DIR=%%~dpfI set NODE=%DIR%\node\node.exe - set NODE_ENV=production If Not Exist "%NODE%" ( diff --git a/test/package/deb.yml b/test/package/deb.yml index 294657e99473f..030fbad39b167 100644 --- a/test/package/deb.yml +++ b/test/package/deb.yml @@ -4,6 +4,10 @@ - install_kibana_deb - assert_keystore_available - assert_keystore_cli + - assert_encryption_keys_cli + - assert_plugin_cli + - assert_setup_cli + - assert_verification_code_cli - assert_kibana_yml - assert_kibana_listening - assert_kibana_available diff --git a/test/package/roles/assert_encryption_keys_cli/tasks/main.yml b/test/package/roles/assert_encryption_keys_cli/tasks/main.yml new file mode 100644 index 0000000000000..f6097c134660d --- /dev/null +++ b/test/package/roles/assert_encryption_keys_cli/tasks/main.yml @@ -0,0 +1,13 @@ +- name: "help generate" + become: true + command: + cmd: /usr/share/kibana/bin/kibana-encryption-keys help generate + register: kibana_encryption_keys_help_generate + +- debug: + msg: "{{ kibana_encryption_keys_help_generate }}" + +- name: assert kibana-encryption-keys provides help + assert: + that: + - kibana_encryption_keys_help_generate.failed == false diff --git a/test/package/roles/assert_keystore_cli/tasks/main.yml b/test/package/roles/assert_keystore_cli/tasks/main.yml index 4ca2622aa5c01..4be2b128493bc 100644 --- a/test/package/roles/assert_keystore_cli/tasks/main.yml +++ b/test/package/roles/assert_keystore_cli/tasks/main.yml @@ -1,20 +1,20 @@ - name: "add server.name: package-testing" - become: yes - command: + become: true + command: cmd: /usr/share/kibana/bin/kibana-keystore add server.name --stdin stdin: package-testing register: kibana_keystore_add - debug: - msg: "{{ kibana_keystore_add.stdout }}" + msg: "{{ kibana_keystore_add }}" - name: register kibana-keystore list - become: yes + become: true command: /usr/share/kibana/bin/kibana-keystore list register: kibana_keystore_list - debug: - msg: "{{ kibana_keystore_list.stdout }}" + msg: "{{ kibana_keystore_list }}" - name: assert kibana-keystore list contains server.name assert: diff --git a/test/package/roles/assert_plugin_cli/tasks/main.yml b/test/package/roles/assert_plugin_cli/tasks/main.yml new file mode 100644 index 0000000000000..0077b839cfbdd --- /dev/null +++ b/test/package/roles/assert_plugin_cli/tasks/main.yml @@ -0,0 +1,14 @@ +- name: "list" + become: true + command: + cmd: /usr/share/kibana/bin/kibana-plugin list + register: kibana_plugin_list + +- debug: + msg: "{{ kibana_plugin_list }}" + +- name: assert kibana-plugin lists installed plugins + assert: + that: + - kibana_plugin_list.failed == false + - kibana_plugin_list.stdout == "No plugins installed." diff --git a/test/package/roles/assert_setup_cli/tasks/main.yml b/test/package/roles/assert_setup_cli/tasks/main.yml new file mode 100644 index 0000000000000..2f6b6ae511d48 --- /dev/null +++ b/test/package/roles/assert_setup_cli/tasks/main.yml @@ -0,0 +1,13 @@ +- name: "--help" + become: true + command: + cmd: /usr/share/kibana/bin/kibana-setup --help + register: kibana_setup_help + +- debug: + msg: "{{ kibana_setup_help }}" + +- name: assert kibana-setup provides help text + assert: + that: + - kibana_setup_help.failed == false diff --git a/test/package/roles/assert_verification_code_cli/tasks/main.yml b/test/package/roles/assert_verification_code_cli/tasks/main.yml new file mode 100644 index 0000000000000..9fd4e32c745ba --- /dev/null +++ b/test/package/roles/assert_verification_code_cli/tasks/main.yml @@ -0,0 +1,13 @@ +- name: "--help" + become: true + command: + cmd: /usr/share/kibana/bin/kibana-verification-code --help + register: kibana_verification_code_help + +- debug: + msg: "{{ kibana_verification_code_help }}" + +- name: assert kibana-verification-code provides help + assert: + that: + - kibana_verification_code_help.failed == false diff --git a/test/package/rpm.yml b/test/package/rpm.yml index 456c2bdf18b72..f717b38797123 100644 --- a/test/package/rpm.yml +++ b/test/package/rpm.yml @@ -4,6 +4,10 @@ - install_kibana_rpm - assert_keystore_available - assert_keystore_cli + - assert_encryption_keys_cli + - assert_plugin_cli + - assert_setup_cli + - assert_verification_code_cli - assert_kibana_yml - assert_kibana_listening - assert_kibana_available