From 237f5e8b1022bc1d62371411159b70d3ee6e3b18 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 27 Feb 2018 10:45:01 +0100 Subject: [PATCH 1/2] Integration test run.sh must fail on error For example if enabling an app failed, it must fail and bail out --- tests/acceptance/run.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/run.sh b/tests/acceptance/run.sh index 9871bceab172..378e43ece2fa 100755 --- a/tests/acceptance/run.sh +++ b/tests/acceptance/run.sh @@ -20,7 +20,7 @@ function env_alt_home_enable { } function env_alt_home_clear { - $OCC app:disable testing + $OCC app:disable testing || { echo "Unable to disable testing app" >&2; exit 1; } } function env_encryption_enable { @@ -29,12 +29,12 @@ function env_encryption_enable { } function env_encryption_enable_master_key { - env_encryption_enable + env_encryption_enable || { echo "Unable to enable user-keys encryption" >&2; exit 1; } $OCC encryption:select-encryption-type masterkey --yes } function env_encryption_enable_user_keys { - env_encryption_enable + env_encryption_enable || { echo "Unable to enable user-keys encryption" >&2; exit 1; } $OCC encryption:select-encryption-type user-keys --yes } @@ -44,12 +44,12 @@ function env_encryption_disable { } function env_encryption_disable_master_key { - env_encryption_disable + env_encryption_disable || { echo "Unable to disable encryption" >&2; exit 1; } $OCC config:app:delete encryption useMasterKey } function env_encryption_disable_users_key { - env_encryption_disable + env_encryption_disable || { echo "Unable to disable encryption" >&2; exit 1; } $OCC config:app:delete encryption userSpecificKey } @@ -83,7 +83,7 @@ $OCC config:system:set files_external_allow_create_new_local --value=true PREVIOUS_TESTING_APP_STATUS=$($OCC --no-warnings app:list "^testing$") if [[ "$PREVIOUS_TESTING_APP_STATUS" =~ ^Disabled: ]] then - $OCC app:enable testing + $OCC app:enable testing || { echo "Unable to enable testing app" >&2; exit 1; } TESTING_ENABLED_BY_SCRIPT=true; else TESTING_ENABLED_BY_SCRIPT=false; From eaadec1be5574548e365a39c81021efd70abc8dd Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 2 Mar 2018 21:39:44 +0545 Subject: [PATCH 2/2] Tidy error messages in acceptance tests run.sh --- tests/acceptance/run.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/run.sh b/tests/acceptance/run.sh index 378e43ece2fa..d6eaae2af718 100755 --- a/tests/acceptance/run.sh +++ b/tests/acceptance/run.sh @@ -29,7 +29,7 @@ function env_encryption_enable { } function env_encryption_enable_master_key { - env_encryption_enable || { echo "Unable to enable user-keys encryption" >&2; exit 1; } + env_encryption_enable || { echo "Unable to enable masterkey encryption" >&2; exit 1; } $OCC encryption:select-encryption-type masterkey --yes } @@ -44,12 +44,12 @@ function env_encryption_disable { } function env_encryption_disable_master_key { - env_encryption_disable || { echo "Unable to disable encryption" >&2; exit 1; } + env_encryption_disable || { echo "Unable to disable masterkey encryption" >&2; exit 1; } $OCC config:app:delete encryption useMasterKey } -function env_encryption_disable_users_key { - env_encryption_disable || { echo "Unable to disable encryption" >&2; exit 1; } +function env_encryption_disable_user_keys { + env_encryption_disable || { echo "Unable to disable user-keys encryption" >&2; exit 1; } $OCC config:app:delete encryption userSpecificKey } @@ -170,7 +170,7 @@ if test "$OC_TEST_ENCRYPTION_MASTER_KEY_ENABLED" = "1"; then fi if test "$OC_TEST_ENCRYPTION_USER_KEYS_ENABLED" = "1"; then - env_encryption_disable_users_key + env_encryption_disable_user_keys fi if [ -z $HIDE_OC_LOGS ]; then