From 7bb4aed56c635bcd1f0994153f3c61483be6834b Mon Sep 17 00:00:00 2001 From: Jawon Choo Date: Tue, 21 Aug 2018 11:28:37 +0900 Subject: [PATCH] Tempest: add option to execute cleanup always This PS makes to control cleanup action. If there are FAILED cases, temepest-test returns non-zero code. _run-tests.sh.tpl exit immediately without cleanup. if set Values.conf.cleanup.force to true, cleanup is excuted always. Change-Id: Ie2ffee8faa9561f8acb4dc762fcfa9a282477f50 Closes-Bug: #1788076 --- tempest/templates/bin/_run-tests.sh.tpl | 4 ++++ tempest/values.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tempest/templates/bin/_run-tests.sh.tpl b/tempest/templates/bin/_run-tests.sh.tpl index 7d0bb34525..11f91fa4d0 100644 --- a/tempest/templates/bin/_run-tests.sh.tpl +++ b/tempest/templates/bin/_run-tests.sh.tpl @@ -20,6 +20,10 @@ set -ex tempest cleanup --init-saved-state +if [ "true" == "{{- .Values.conf.cleanup.force -}}" ]; then +trap "tempest cleanup; exit" 1 ERR +fi + {{ .Values.conf.script }} tempest cleanup diff --git a/tempest/values.yaml b/tempest/values.yaml index 3dcd83a4ca..d64642b562 100644 --- a/tempest/values.yaml +++ b/tempest/values.yaml @@ -198,6 +198,8 @@ conf: volume-feature-enabled: api_v1: False api_v3: True + cleanup: + force: false pvc: enabled: true