Skip to content

Commit

Permalink
fix e2e test script
Browse files Browse the repository at this point in the history
fix test script for macOS.
use example ip address from https://datatracker.ietf.org/doc/html/rfc5737.

Signed-off-by: Jack Ding <jackding@gmail.com>
  • Loading branch information
jzding committed Jul 18, 2024
1 parent 5c5eb38 commit 8430b20
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ else
GOBIN=$(shell go env GOBIN)
endif

OS := $(shell uname -s)

kustomize:
ifeq (, $(shell which kustomize))
@{ \
Expand All @@ -47,9 +49,15 @@ check-env:

# Configure redfish credentials and BMC ip from environment variables
redfish-config:
ifeq ($(OS), Darwin)
@sed -i "" -e "s/username=.*/username=${REDFISH_USERNAME}/" ./manifests/proxy/kustomization.yaml
@sed -i "" -e "s/password=.*/password=${REDFISH_PASSWORD}/" ./manifests/proxy/kustomization.yaml
@sed -i "" -e "s/hostaddr=.*/hostaddr=${REDFISH_HOSTADDR}/" ./manifests/proxy/kustomization.yaml
else
@sed -i -e "s/username=.*/username=${REDFISH_USERNAME}/" ./manifests/proxy/kustomization.yaml
@sed -i -e "s/password=.*/password=${REDFISH_PASSWORD}/" ./manifests/proxy/kustomization.yaml
@sed -i -e "s/hostaddr=.*/hostaddr=${REDFISH_HOSTADDR}/" ./manifests/proxy/kustomization.yaml
endif

# label the first Ready worker node as local
label-node:
Expand Down
18 changes: 10 additions & 8 deletions e2e-tests/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,16 @@ fi

# number of additional consumers need to deploy/undeploy
NUM_OF_CONSUMER=`expr $n_consumer - 1`
for i in `seq $NUM_OF_CONSUMER`
do
wait_for_resource deployment/consumer-$i available 60s >/dev/null 2>&1
if [[ $job_result -eq 1 ]]; then
echo "Consumer-$i pod is not available"
exit 1
fi
done
if [[ $NUM_OF_CONSUMER -gt 0 ]]; then
for i in `seq $NUM_OF_CONSUMER`
do
wait_for_resource deployment/consumer-$i available 60s >/dev/null 2>&1
if [[ $job_result -eq 1 ]]; then
echo "Consumer-$i pod is not available"
exit 1
fi
done
fi

# uncomment this when debugging image issues in a ci job
# check_images
Expand Down
2 changes: 1 addition & 1 deletion manifests/proxy/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ secretGenerator:
- literals:
- username=root
- password=calvin
- hostaddr=10.16.230.6
- hostaddr=192.0.2.1
name: redfish-basic-auth
type: Opaque
images:
Expand Down

0 comments on commit 8430b20

Please sign in to comment.