Skip to content

Commit 4b977b7

Browse files
committed
Move psm::lang::source_install_lib to psm-interop-install-lib.sh
1 parent 44e848f commit 4b977b7

3 files changed

Lines changed: 34 additions & 34 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2024 gRPC authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
set -eo pipefail
16+
17+
# Used locally.
18+
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
19+
20+
psm::lang::source_install_lib() {
21+
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
22+
local install_lib
23+
# Download to a tmp file.
24+
install_lib="$(mktemp -d)/psm_interop_kokoro_lib.sh"
25+
curl -s --retry-connrefused --retry 5 -o "${install_lib}" "${TEST_DRIVER_INSTALL_SCRIPT_URL}"
26+
# Checksum.
27+
if command -v sha256sum &> /dev/null; then
28+
echo "Install script checksum:"
29+
sha256sum "${install_lib}"
30+
fi
31+
source "${install_lib}"
32+
}

tools/internal_ci/linux/psm-interop-test-cpp.sh

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,7 @@ set -eo pipefail
1818
readonly GRPC_LANGUAGE="cpp"
1919
readonly BUILD_SCRIPT_DIR="$(dirname "$0")"
2020

21-
# Used locally.
22-
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
23-
24-
psm::lang::source_install_lib() {
25-
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
26-
local install_lib
27-
# Download to a tmp file.
28-
install_lib="$(mktemp -d)/psm_interop_kokoro_lib.sh"
29-
curl -s --retry-connrefused --retry 5 -o "${install_lib}" "${TEST_DRIVER_INSTALL_SCRIPT_URL}"
30-
# Checksum.
31-
if command -v sha256sum &> /dev/null; then
32-
echo "Install script checksum:"
33-
sha256sum "${install_lib}"
34-
fi
35-
source "${install_lib}"
36-
}
37-
21+
source "${BUILD_SCRIPT_DIR}/psm-interop-install-lib.sh"
3822
psm::lang::source_install_lib
3923
source "${BUILD_SCRIPT_DIR}/psm-interop-build-${GRPC_LANGUAGE}.sh"
4024
psm::run "${PSM_TEST_SUITE}"

tools/internal_ci/linux/psm-interop-test-python.sh

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,7 @@ set -eo pipefail
1818
readonly GRPC_LANGUAGE="python"
1919
readonly BUILD_SCRIPT_DIR="$(dirname "$0")"
2020

21-
# Used locally.
22-
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
23-
24-
psm::lang::source_install_lib() {
25-
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
26-
local install_lib
27-
# Download to a tmp file.
28-
install_lib="$(mktemp -d)/psm_interop_kokoro_lib.sh"
29-
curl -s --retry-connrefused --retry 5 -o "${install_lib}" "${TEST_DRIVER_INSTALL_SCRIPT_URL}"
30-
# Checksum.
31-
if command -v sha256sum &> /dev/null; then
32-
echo "Install script checksum:"
33-
sha256sum "${install_lib}"
34-
fi
35-
source "${install_lib}"
36-
}
37-
21+
source "${BUILD_SCRIPT_DIR}/psm-interop-install-lib.sh"
3822
psm::lang::source_install_lib
3923
source "${BUILD_SCRIPT_DIR}/psm-interop-build-${GRPC_LANGUAGE}.sh"
4024
psm::run "${PSM_TEST_SUITE}"

0 commit comments

Comments
 (0)