gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: tests: do dynamic sync_provider


From: gnunet
Subject: [taler-anastasis] branch master updated: tests: do dynamic sync_provider calls until finished
Date: Thu, 14 Apr 2022 19:44:26 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 8cffd75  tests: do dynamic sync_provider calls until finished
8cffd75 is described below

commit 8cffd756c90b296c699eba070021a784d2ecdb8a
Author: Florian Dold <florian@dold.me>
AuthorDate: Thu Apr 14 19:44:14 2022 +0200

    tests: do dynamic sync_provider calls until finished
---
 contrib/gana                                       |  2 +-
 ...tasis_reducer_recovery_enter_user_attributes.sh | 26 ++++++++++++----------
 src/reducer/anastasis_api_recovery_redux.c         |  2 +-
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/contrib/gana b/contrib/gana
index c014598..7bfddee 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit c0145987a932ff26839de609108f17cd6c63bdd2
+Subproject commit 7bfddee1d6e2c04beb9f89a42acad70299fc423f
diff --git a/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh 
b/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
index 3a62704..10799e6 100755
--- a/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
+++ b/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
@@ -437,20 +437,22 @@ then
 fi
 echo " OK"
 
-echo -n "Synchronizing providers"
-anastasis-reducer sync_providers < $R2FILE > $R1FILE
-anastasis-reducer sync_providers < $R1FILE > $R2FILE
-# This one will fail, as we should now have all 3 providers
-# used by the policy in sync!
-anastasis-reducer sync_providers < $R2FILE > $R1FILE 2> /dev/null || true
-# Note: continue with $R2FILE, the last one that was valid!
+# Sync with providers (up to 3 providers aren't synced here)
+for x in 1 2 3; do
+  echo "Synchronizing providers (round $x)"
+  anastasis-reducer sync_providers < $R2FILE > $R1FILE 2> /dev/null || true
+  CODE=$(jq -r -e ".code // 0" < $R1FILE)
+  if test "$CODE" = "8420"; then
+    break
+  fi
+  if test "$CODE" != "0"; then
+    exit_fail "Expected no error or 8420, got $CODE"
+  fi
+  cat $R1FILE > $R2FILE
+done
 
 CODE=`jq -r -e .code < $R1FILE`
-if test "$CODE" != "8400"
-then
-    exit_fail "Expected to be synced, instead the code is '$CODE'"
-fi
-echo " OK"
+echo "Providers synced."
 
 
 echo -n "Running challenge logic ..."
diff --git a/src/reducer/anastasis_api_recovery_redux.c 
b/src/reducer/anastasis_api_recovery_redux.c
index b0c15ec..d831adc 100644
--- a/src/reducer/anastasis_api_recovery_redux.c
+++ b/src/reducer/anastasis_api_recovery_redux.c
@@ -2221,7 +2221,7 @@ sync_providers (json_t *state,
     clean_sync (ms);
     ANASTASIS_redux_fail_ (cb,
                            cb_cls,
-                           TALER_EC_ANASTASIS_REDUCER_ACTION_INVALID,
+                           TALER_EC_ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED,
                            "already in sync");
     return NULL;
   }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]