Skip to content

Commit 9bc501b

Browse files
committed
Test also default subscription
1 parent 5798ee3 commit 9bc501b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

scripts/test-stack-command.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ if [ "${VERSION}" != "default" ]; then
5050
fi
5151

5252
OUTPUT_PATH_STATUS="build/elastic-stack-status/${VERSION}"
53-
profile=default
5453

5554
if [ "${APM_SERVER_ENABLED}" = true ]; then
5655
OUTPUT_PATH_STATUS="build/elastic-stack-status/${VERSION}_with_apm_server"
@@ -87,12 +86,6 @@ stack.elastic_subscription: ${ELASTIC_LICENSE}
8786
EOF
8887
fi
8988

90-
if [ -f ~/.elastic-package/profiles/${profile}/config.yml ]; then
91-
echo "--- Show profile used"
92-
cat ~/.elastic-package/profiles/${profile}/config.yml
93-
fi
94-
95-
9689
mkdir -p "${OUTPUT_PATH_STATUS}"
9790

9891
# Initial status empty
@@ -149,16 +142,22 @@ if [ "${SELF_MONITOR_ENABLED}" = true ]; then
149142
-f "${ELASTIC_PACKAGE_ELASTICSEARCH_HOST}/metrics-system.*/_search?allow_no_indices=false&size=0"
150143
fi
151144

145+
license=$(curl -s -S \
146+
-u "${ELASTIC_PACKAGE_ELASTICSEARCH_USERNAME}:${ELASTIC_PACKAGE_ELASTICSEARCH_PASSWORD}" \
147+
--cacert "${ELASTIC_PACKAGE_CA_CERT}" \
148+
-f "${ELASTIC_PACKAGE_ELASTICSEARCH_HOST}/_license" |jq -r '.license.type')
149+
152150
if [[ "${ELASTIC_LICENSE}" != "" ]]; then
153-
# Check that there is some data in the system indexes.
154-
license=$(curl -s -S \
155-
-u "${ELASTIC_PACKAGE_ELASTICSEARCH_USERNAME}:${ELASTIC_PACKAGE_ELASTICSEARCH_PASSWORD}" \
156-
--cacert "${ELASTIC_PACKAGE_CA_CERT}" \
157-
-f "${ELASTIC_PACKAGE_ELASTICSEARCH_HOST}/_license" |jq -r '.license.type')
158151
if [[ "${license}" != "${ELASTIC_LICENSE}" ]]; then
159152
echo "Unexpected license found: ${license}"
160153
exit 1
161154
fi
155+
else
156+
# If not defined, elastic license/subscription must be trial
157+
if [[ "${license}" != "trial" ]]; then
158+
echo "Unexpected license found: ${license}"
159+
exit 1
160+
fi
162161
fi
163162

164163
diff -q "${OUTPUT_PATH_STATUS}/running_no_spaces.txt" "${OUTPUT_PATH_STATUS}/expected_no_spaces.txt"

0 commit comments

Comments
 (0)