From 6bc11e45bce892b7063416d2227ef22fceb9b3cc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 18 Oct 2024 22:31:01 +0200 Subject: [PATCH 1/2] ci: Fix restoring the domain and skeleton of the main and real-fed server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before both used the same variables to store the data 🙈 Signed-off-by: Joas Schilling --- tests/integration/run.sh | 54 ++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/tests/integration/run.sh b/tests/integration/run.sh index 33d4fddeae9..e66a727856a 100755 --- a/tests/integration/run.sh +++ b/tests/integration/run.sh @@ -89,22 +89,22 @@ export MAIN_SERVER_CONFIG_DIR export REAL_FEDERATED_SERVER_CONFIG_DIR export NEXTCLOUD_CONFIG_DIR="$MAIN_SERVER_CONFIG_DIR" -OVERWRITE_CLI_URL=$(${ROOT_DIR}/occ config:system:get overwrite.cli.url) +MAIN_OVERWRITE_CLI_URL=$(${ROOT_DIR}/occ config:system:get overwrite.cli.url) +MAIN_SKELETON_DIR=$(${ROOT_DIR}/occ config:system:get skeletondirectory) ${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "http://localhost:8080/" +if [[ "$MAIN_SKELETON_DIR" != "" && -d $MAIN_SKELETON_DIR ]]; then + echo "Resetting custom skeletondirectory so that tests pass" + ${ROOT_DIR}/occ config:system:delete skeletondirectory +fi export NEXTCLOUD_CONFIG_DIR="$REAL_FEDERATED_SERVER_CONFIG_DIR" -OVERWRITE_CLI_URL=$(${ROOT_DIR}/occ config:system:get overwrite.cli.url) +REAL_FEDERATED_OVERWRITE_CLI_URL=$(${ROOT_DIR}/occ config:system:get overwrite.cli.url) +REAL_FEDERATED_SKELETON_DIR=$(${ROOT_DIR}/occ config:system:get skeletondirectory) ${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "$TEST_REMOTE_URL" - -for CONFIG_DIR in $MAIN_SERVER_CONFIG_DIR $REAL_FEDERATED_SERVER_CONFIG_DIR; do - export NEXTCLOUD_CONFIG_DIR="$CONFIG_DIR" - - SKELETON_DIR=$(${ROOT_DIR}/occ config:system:get skeletondirectory) - if [[ "$SKELETON_DIR" ]]; then - echo "Resetting custom skeletondirectory so that tests pass" - ${ROOT_DIR}/occ config:system:delete skeletondirectory - fi -done +if [[ "$REAL_FEDERATED_SKELETON_DIR" != "" && -d $REAL_FEDERATED_SKELETON_DIR ]]; then + echo "Resetting custom skeletondirectory so that tests pass" + ${ROOT_DIR}/occ config:system:delete skeletondirectory +fi echo '' echo -e "\033[0;36m#\033[0m" @@ -193,18 +193,25 @@ echo '' echo -e "\033[0;36m#\033[0m" echo -e "\033[0;36m# Reverting configuration changes and disabling spreedcheats\033[0m" echo -e "\033[0;36m#\033[0m" -for CONFIG_DIR in $MAIN_SERVER_CONFIG_DIR $REAL_FEDERATED_SERVER_CONFIG_DIR; do - export NEXTCLOUD_CONFIG_DIR="$CONFIG_DIR" - ${ROOT_DIR}/occ app:disable spreedcheats - ${ROOT_DIR}/occ config:system:set overwrite.cli.url --value $OVERWRITE_CLI_URL - if [[ "$SKELETON_DIR" ]]; then - ${ROOT_DIR}/occ config:system:set skeletondirectory --value "$SKELETON_DIR" - fi -done +# Main server +export NEXTCLOUD_CONFIG_DIR="$MAIN_SERVER_CONFIG_DIR" +${ROOT_DIR}/occ app:disable spreedcheats +${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "$MAIN_OVERWRITE_CLI_URL" +if [[ "$MAIN_SKELETON_DIR" != "" && -d $MAIN_SKELETON_DIR ]]; then + ${ROOT_DIR}/occ config:system:set skeletondirectory --value "$MAIN_SKELETON_DIR" +fi +# Real federated server if $DESTROY_REAL_FEDERATED_SERVER; then - rm -rf "$REAL_FEDERATED_SERVER_CONFIG_DIR" "$REAL_FEDERATED_SERVER_DATA_DIR" + rm -rf "'$REAL_FEDERATED_SERVER_CONFIG_DIR'" "'$REAL_FEDERATED_SERVER_DATA_DIR'" +else + export NEXTCLOUD_CONFIG_DIR="$REAL_FEDERATED_SERVER_CONFIG_DIR" + ${ROOT_DIR}/occ app:disable spreedcheats + ${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "$REAL_FEDERATED_OVERWRITE_CLI_URL" + if [[ "$REAL_FEDERATED_SKELETON_DIR" != "" && -d $REAL_FEDERATED_SKELETON_DIR ]]; then + ${ROOT_DIR}/occ config:system:set skeletondirectory --value "$REAL_FEDERATED_SKELETON_DIR" + fi fi rm -rf ../../../spreedcheats @@ -213,4 +220,9 @@ wait $PHPPID1 wait $PHPPID2 wait $PHPPID3 +echo '' +echo -e "\033[0;36m#\033[0m" +echo -e "\033[0;36m# Gracefully completed\033[0m" +echo -e "\033[0;36m#\033[0m" + exit $RESULT From 1225e9ccec5b460c7052000217a7f8c96eb7517b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 21 Oct 2024 09:25:52 +0200 Subject: [PATCH 2/2] ci: Always reset the skeleton directory Signed-off-by: Joas Schilling --- tests/integration/run.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration/run.sh b/tests/integration/run.sh index e66a727856a..2311994f02e 100755 --- a/tests/integration/run.sh +++ b/tests/integration/run.sh @@ -92,7 +92,7 @@ export NEXTCLOUD_CONFIG_DIR="$MAIN_SERVER_CONFIG_DIR" MAIN_OVERWRITE_CLI_URL=$(${ROOT_DIR}/occ config:system:get overwrite.cli.url) MAIN_SKELETON_DIR=$(${ROOT_DIR}/occ config:system:get skeletondirectory) ${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "http://localhost:8080/" -if [[ "$MAIN_SKELETON_DIR" != "" && -d $MAIN_SKELETON_DIR ]]; then +if [[ "$MAIN_SKELETON_DIR" != "" ]]; then echo "Resetting custom skeletondirectory so that tests pass" ${ROOT_DIR}/occ config:system:delete skeletondirectory fi @@ -101,7 +101,7 @@ export NEXTCLOUD_CONFIG_DIR="$REAL_FEDERATED_SERVER_CONFIG_DIR" REAL_FEDERATED_OVERWRITE_CLI_URL=$(${ROOT_DIR}/occ config:system:get overwrite.cli.url) REAL_FEDERATED_SKELETON_DIR=$(${ROOT_DIR}/occ config:system:get skeletondirectory) ${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "$TEST_REMOTE_URL" -if [[ "$REAL_FEDERATED_SKELETON_DIR" != "" && -d $REAL_FEDERATED_SKELETON_DIR ]]; then +if [[ "$REAL_FEDERATED_SKELETON_DIR" != "" ]]; then echo "Resetting custom skeletondirectory so that tests pass" ${ROOT_DIR}/occ config:system:delete skeletondirectory fi @@ -198,18 +198,18 @@ echo -e "\033[0;36m#\033[0m" export NEXTCLOUD_CONFIG_DIR="$MAIN_SERVER_CONFIG_DIR" ${ROOT_DIR}/occ app:disable spreedcheats ${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "$MAIN_OVERWRITE_CLI_URL" -if [[ "$MAIN_SKELETON_DIR" != "" && -d $MAIN_SKELETON_DIR ]]; then +if [[ "$MAIN_SKELETON_DIR" != "" ]]; then ${ROOT_DIR}/occ config:system:set skeletondirectory --value "$MAIN_SKELETON_DIR" fi # Real federated server if $DESTROY_REAL_FEDERATED_SERVER; then - rm -rf "'$REAL_FEDERATED_SERVER_CONFIG_DIR'" "'$REAL_FEDERATED_SERVER_DATA_DIR'" + rm -rf "$REAL_FEDERATED_SERVER_CONFIG_DIR" "$REAL_FEDERATED_SERVER_DATA_DIR" else export NEXTCLOUD_CONFIG_DIR="$REAL_FEDERATED_SERVER_CONFIG_DIR" ${ROOT_DIR}/occ app:disable spreedcheats ${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "$REAL_FEDERATED_OVERWRITE_CLI_URL" - if [[ "$REAL_FEDERATED_SKELETON_DIR" != "" && -d $REAL_FEDERATED_SKELETON_DIR ]]; then + if [[ "$REAL_FEDERATED_SKELETON_DIR" != "" ]]; then ${ROOT_DIR}/occ config:system:set skeletondirectory --value "$REAL_FEDERATED_SKELETON_DIR" fi fi