forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version_out_test.sh
executable file
·28 lines (19 loc) · 893 Bytes
/
version_out_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
set -e -o pipefail
# Undo LC_ALL=en_US.UTF-8, since it breaks sed.
export LC_ALL=C
ENVOY_BIN="${TEST_SRCDIR}/envoy/source/exe/envoy-static"
COMMIT=$(${ENVOY_BIN} --version | \
sed -n -E 's/.*version: ([0-9a-f]{40})\/([0-9]+\.[0-9]+\.[0-9]+)(-[a-zA-Z0-9_\-]+)?\/(Clean|Modified)\/(RELEASE|DEBUG)\/([a-zA-Z-]+)$/\1/p')
EXPECTED=$(cat "${TEST_SRCDIR}/envoy/bazel/raw_build_id.ldscript")
if [[ "${COMMIT}" != "${EXPECTED}" ]]; then
echo "Commit mismatch, got: ${COMMIT}, expected: ${EXPECTED}".
exit 1
fi
VERSION=$(${ENVOY_BIN} --version | \
sed -n -E 's/.*version: ([0-9a-f]{40})\/([0-9]+\.[0-9]+\.[0-9]+)(-[a-zA-Z0-9_\-]+)?\/(Clean|Modified)\/(RELEASE|DEBUG)\/([a-zA-Z-]+)$/\2\3/p')
EXPECTED=$(cat "${TEST_SRCDIR}/envoy/VERSION.txt")
if [[ "${VERSION}" != "${EXPECTED}" ]]; then
echo "Version mismatch, got: ${VERSION}, expected: ${EXPECTED}".
exit 1
fi