@@ -32,7 +32,11 @@ default_version() {
3232
3333clean_status_output () {
3434 local output_file=" $1 "
35- cat " ${output_file} " | grep " │" | tr -d ' '
35+ # This removes the 'IMAGE BUILD DATE" and 'VCS REF' columns and
36+ # removes the whitespace between columns.
37+ grep " │" " ${output_file} " \
38+ | cut -d ' │' -f 1-4,7- \
39+ | tr -d ' '
3640}
3741
3842trap cleanup EXIT
@@ -90,20 +94,20 @@ curl --cacert "${ELASTIC_PACKAGE_CA_CERT}" -f "${ELASTIC_PACKAGE_KIBANA_HOST}/lo
9094# Check status with running services
9195cat << EOF > "${OUTPUT_PATH_STATUS} /expected_running.txt"
9296Status of Elastic stack services:
93- ╭──────────────────┬─────────┬───────────────────╮
94- │ SERVICE │ VERSION │ STATUS │
95- ├──────────────────┼─────────┼───────────────────┤
96- │ elastic-agent │ ${EXPECTED_VERSION} │ running (healthy) │
97- │ elasticsearch │ ${EXPECTED_VERSION} │ running (healthy) │
98- │ fleet-server │ ${EXPECTED_VERSION} │ running (healthy) │
99- │ kibana │ ${EXPECTED_VERSION} │ running (healthy) │
100- │ package-registry │ latest │ running (healthy) │
101- ╰──────────────────┴─────────┴───────────────────╯
97+ ╭──────────────────┬───────────────────── ┬───────────────────┬───────────────────┬ ────────────╮
98+ │ SERVICE │ VERSION │ STATUS │ IMAGE BUILD DATE │ VCS REF │
99+ ├──────────────────┼───────────────────── ┼───────────────────┼───────────────────┼ ────────────┤
100+ │ elastic-agent │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T02:44Z │ b96a4ca8fa │
101+ │ elasticsearch │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T13:26Z │ 1362d56865 │
102+ │ fleet-server │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T02:44Z │ b96a4ca8fa │
103+ │ kibana │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T11:09Z │ cdcdfddd3f │
104+ │ package-registry │ latest │ running (healthy) │ │ │
105+ ╰──────────────────┴───────────────────── ┴───────────────────┴───────────────────┴ ────────────╯
102106EOF
103107
104108elastic-package stack status -v 2> " ${OUTPUT_PATH_STATUS} /running.txt"
105109
106- # Remove spaces to avoid issues with spaces between columns
110+ # Remove dates, commit IDs, and spaces to avoid issues.
107111clean_status_output " ${OUTPUT_PATH_STATUS} /expected_running.txt" > " ${OUTPUT_PATH_STATUS} /expected_no_spaces.txt"
108112clean_status_output " ${OUTPUT_PATH_STATUS} /running.txt" > " ${OUTPUT_PATH_STATUS} /running_no_spaces.txt"
109113
0 commit comments