Skip to content

Commit 4b6d097

Browse files
committed
Merge pull request #1563 from liggitt/fix_end_to_end
Separate e2e-user config file in end to end
2 parents 11f00ab + 16df0e8 commit 4b6d097

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

hack/test-end-to-end.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,15 @@ if [[ "${API_SCHEME}" == "https" ]]; then
229229
# Make osc use ${CERT_DIR}/admin/.kubeconfig, and ignore anything in the running user's $HOME dir
230230
export HOME="${CERT_DIR}/admin"
231231
sudo chmod -R a+rwX "${HOME}"
232-
export OPENSHIFTCONFIG="${CERT_DIR}/admin/.kubeconfig"
232+
233+
# cluster admin (superuser) config
234+
ADMIN_OPENSHIFTCONFIG="${CERT_DIR}/admin/.kubeconfig"
235+
# e2e-user (project admin and viewer) config
236+
# initialized with a copy of the cluster admin's config to pick up server name and certificate authority
237+
E2EUSER_OPENSHIFTCONFIG="${CERT_DIR}/e2euser.kubeconfig"
238+
cp "${ADMIN_OPENSHIFTCONFIG}" "${E2EUSER_OPENSHIFTCONFIG}"
239+
240+
export OPENSHIFTCONFIG="${ADMIN_OPENSHIFTCONFIG}"
233241
echo "[INFO] To debug: export OPENSHIFTCONFIG=$OPENSHIFTCONFIG"
234242
fi
235243

@@ -285,15 +293,22 @@ osc process -n custom -f examples/sample-app/application-template-custombuild.js
285293

286294
# Client setup (log in as e2e-user and set 'test' as the default project)
287295
echo "[INFO] Logging in as a regular user (e2e-user:pass) with project 'test'..."
296+
export OPENSHIFTCONFIG="${E2EUSER_OPENSHIFTCONFIG}"
297+
echo "[INFO] To debug: export OPENSHIFTCONFIG=$OPENSHIFTCONFIG"
288298
osc login -u e2e-user -p pass
289299
osc project test
290300

291301
echo "[INFO] Applying STI application config"
292302
osc create -f "${STI_CONFIG_FILE}"
293303

304+
echo "[INFO] Back to 'master' context with 'system:admin' user..."
305+
export OPENSHIFTCONFIG="${ADMIN_OPENSHIFTCONFIG}"
306+
echo "[INFO] To debug: export OPENSHIFTCONFIG=$OPENSHIFTCONFIG"
307+
294308
# Trigger build
295309
echo "[INFO] Starting build from ${STI_CONFIG_FILE} and streaming its logs..."
296310
#osc start-build -n test ruby-sample-build --follow
311+
# must be done as cluster-admin until build-logs no longer uses /proxy
297312
wait_for_build "test"
298313
wait_for_app "test"
299314

@@ -313,9 +328,6 @@ wait_for_app "test"
313328

314329
# ensure the router is started
315330
# TODO: simplify when #4702 is fixed upstream
316-
echo "[INFO] Back to 'master' context with 'admin' user..."
317-
osc project master
318-
319331
wait_for_command '[[ "$(osc get endpoints router -t "{{ if .endpoints }}{{ len .endpoints }}{{ else }}0{{ end }}" || echo "0")" != "0" ]]' $((5*TIME_MIN))
320332

321333
echo "[INFO] Validating routed app response..."

0 commit comments

Comments
 (0)