File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/integration-tests/bash Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1616# PV_ROOT The root directory on the kubernetes cluster
1717# used for persistent volumes.
1818#
19+ # LEASE_ID Set this if you want cleanup to release the
20+ # given lease on a failure.
21+ #
1922# See 'run.sh' for a detailed description of RESULT_ROOT and PV_ROOT.
2023#
2124# --------------------
4043#
4144# Phase 4: Delete the local test output directory.
4245#
46+ # Phase 5: If we own a lease, then release it on a failure
47+ # see LEASE_ID above.
48+ #
4349
4450DOMAINS=(domain1 domain2 domain3 domain4 domain5)
4551DOMAIN_NAMESPACES=(default default test1 test2 default)
@@ -334,6 +340,18 @@ rm -f /tmp/test_suite.*
334340
335341# Bye
336342
343+ if [ ! " $LEASE_ID " = " " ] && [ ! " $SUCCESS " = " 0" ]; then
344+ # release the lease if we own it
345+ ${SCRIPTPATH} /lease.sh -d " $LEASE_ID " > /tmp/release_lease.out 2>&1
346+ if [ " $? " = " 0" ]; then
347+ echo @@ Lease released.
348+ else
349+ echo @@ Lease could not be released:
350+ cat /tmp/release_lease.out
351+ fi
352+ rm -f /tmp/release_lease.out
353+ fi
354+
337355echo @@ Exiting with status $SUCCESS
338356exit $SUCCESS
339357
You can’t perform that action at this time.
0 commit comments