|
5 | 5 | # |
6 | 6 | # Note: need to run this as root |
7 | 7 | # |
8 | | -# Usage: test_basics.sh <pg_major_version> <citus_full_version> <pg_binary_path> |
| 8 | +# Usage: test_basics.sh <expected_pg_major_version> <expected_citus_full_version> <pg_binary_path> |
9 | 9 | # Example: test_basics.sh 18 14.0.0 /usr/lib/postgresql/17/bin |
10 | 10 |
|
11 | 11 | set -euo pipefail |
12 | 12 |
|
13 | 13 | if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then |
14 | 14 | echo "Error: some arguments are missing." >&2 |
15 | | - echo "Usage: $0 <pg_major_version> <citus_full_version> <pg_binary_path>" >&2 |
| 15 | + echo "Usage: $0 <expected_pg_major_version> <expected_citus_full_version> <pg_binary_path>" >&2 |
16 | 16 | exit 1 |
17 | 17 | fi |
18 | 18 |
|
19 | | -PG_MAJOR_VERSION="$1" |
20 | | -CITUS_FULL_VERSION="$2" |
| 19 | +EXPECTED_PG_MAJOR_VERSION="$1" |
| 20 | +EXPECTED_CITUS_FULL_VERSION="$2" |
21 | 21 | PG_BIN="$3" |
22 | 22 |
|
23 | 23 | ## constants and helpers |
|
64 | 64 | ## verify PG version |
65 | 65 |
|
66 | 66 | pg_version=$(run_psql_cmd "$FIRST_NODE_PORT" "SELECT version();") |
67 | | -if [[ "$pg_version" != "PostgreSQL ${PG_MAJOR_VERSION}."* ]]; then |
68 | | - echo "Error: PostgreSQL version verification failed. Expected version to start with 'PostgreSQL ${PG_MAJOR_VERSION}.', got: $pg_version" >&2 |
| 67 | +if [[ "$pg_version" != "PostgreSQL ${EXPECTED_PG_MAJOR_VERSION}."* ]]; then |
| 68 | + echo "Error: PostgreSQL version verification failed. Expected version to start with 'PostgreSQL ${EXPECTED_PG_MAJOR_VERSION}.', got: $pg_version" >&2 |
69 | 69 | exit 1 |
70 | 70 | else |
71 | 71 | echo "Verified PostgreSQL version: $pg_version" |
|
74 | 74 | ## verify Citus extension version |
75 | 75 |
|
76 | 76 | citus_version=$(run_psql_cmd "$FIRST_NODE_PORT" "SHOW citus.version;") |
77 | | -if [[ "$citus_version" != "${CITUS_FULL_VERSION}"* ]]; then |
78 | | - echo "Error: Citus version verification failed. Expected version to start with '${CITUS_FULL_VERSION}', got: $citus_version" >&2 |
| 77 | +if [[ "$citus_version" != "${EXPECTED_CITUS_FULL_VERSION}"* ]]; then |
| 78 | + echo "Error: Citus version verification failed. Expected version to start with '${EXPECTED_CITUS_FULL_VERSION}', got: $citus_version" >&2 |
79 | 79 | exit 1 |
80 | 80 | else |
81 | 81 | echo "Verified Citus version: $citus_version" |
|
0 commit comments