Skip to content

Commit 1538017

Browse files
authored
Enhance E2E job (#805)
1 parent d584542 commit 1538017

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

hack/boskos.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set -o pipefail
2121
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
2222

2323
USER="cluster-api-provider-ibmcloud"
24-
RESOURCE_TYPE="${RESOURCE_TYPE:-"powervs-project"}"
24+
RESOURCE_TYPE="${RESOURCE_TYPE:-"powervs-service"}"
2525

2626
release_account(){
2727
url="http://${BOSKOS_HOST}/release?name=${BOSKOS_RESOURCE_NAME}&dest=dirty&owner=${USER}"
@@ -35,11 +35,14 @@ release_account(){
3535

3636
checkout_account(){
3737
url="http://${BOSKOS_HOST}/acquire?type=${RESOURCE_TYPE}&state=free&dest=busy&owner=${USER}"
38-
resource_name=$(curl -X POST ${url} | jq -r '.name')
38+
output=$(curl -X POST ${url})
3939
[ $? = 0 ] && status_code=200
4040

4141
if [[ ${status_code} == 200 ]]; then
42-
echo "export BOSKOS_RESOURCE_NAME=${resource_name}"
42+
echo "export BOSKOS_RESOURCE_NAME=$(echo ${output} | jq -r '.name')"
43+
echo "export BOSKOS_RESOURCE_ID=$(echo ${output} | jq -r '.userdata["service-instance-id"]')"
44+
echo "export IBMCLOUD_API_KEY=$(echo ${output} | jq -r '.userdata["api-key"]')"
45+
echo "export RESOURCE_GROUP=$(echo ${output} | jq -r '.userdata["resource-group"]')"
4346
else
4447
echo "Got invalid response- ${status_code}"
4548
exit 1

scripts/ci-e2e.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@ ARCH=$(uname -m)
3737
PVSADM_VERSION=${PVSADM_VERSION:-"v0.1.4-alpha.3"}
3838
E2E_FLAVOR=${E2E_FLAVOR:-}
3939
REGION=${REGION:-"us-south"}
40-
RESOURCE_GROUP=${RESOURCE_GROUP:-"prow-resource-group"}
4140

4241
trap cleanup EXIT
4342

4443
cleanup(){
45-
# Delete the created ports for the network instance
46-
[ -n "${NEW_PORT}" ] && ./pvsadm delete port --network ${IBMPOWERVS_NETWORK_NAME} --port-id ${PORT_ID} --instance-id ${IBMPOWERVS_SERVICE_INSTANCE_ID}
47-
4844
# stop the boskos heartbeat
4945
[[ -z ${HEART_BEAT_PID:-} ]] || kill -9 "${HEART_BEAT_PID}" || true
5046
}
@@ -91,9 +87,10 @@ init_network_powervs(){
9187

9288
prerequisites_powervs(){
9389
# Assigning PowerVS variables
94-
export IBMPOWERVS_IMAGE_NAME=${IBMPOWERVS_IMAGE_NAME:-"capibm-powervs-centos-streams8-1-22-4"}
95-
export IBMPOWERVS_SERVICE_INSTANCE_ID=${IBMPOWERVS_SERVICE_INSTANCE_ID:-"0f28d13a-6e33-4d86-b6d7-a9b46ff7659e"}
96-
export IBMPOWERVS_NETWORK_NAME=${BOSKOS_RESOURCE_NAME:-"capi-e2e-test"}
90+
export IBMPOWERVS_SSHKEY_NAME=${IBMPOWERVS_SSHKEY_NAME:-"powercloud-bot-key"}
91+
export IBMPOWERVS_IMAGE_NAME=${IBMPOWERVS_IMAGE_NAME:-"capibm-powervs-centos-streams8-1-24-2"}
92+
export IBMPOWERVS_SERVICE_INSTANCE_ID=${BOSKOS_RESOURCE_ID:-"0f28d13a-6e33-4d86-b6d7-a9b46ff7659e"}
93+
export IBMPOWERVS_NETWORK_NAME="capi-net-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head --bytes 5)"
9794
# Setting controller loglevel to allow debug logs from the PowerVS client
9895
export LOGLEVEL=5
9996
}
@@ -126,7 +123,7 @@ main(){
126123
HEART_BEAT_PID=$(echo $!)
127124
fi
128125

129-
if [[ "${E2E_FLAVOR}" == "powervs" ]]; then
126+
if [[ "${E2E_FLAVOR}" == "powervs" || "${E2E_FLAVOR}" == "md-remediation" ]]; then
130127
prerequisites_powervs
131128
init_network_powervs
132129
fi

0 commit comments

Comments
 (0)