gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: tests: fix provider selection a


From: gnunet
Subject: [taler-anastasis] branch master updated: tests: fix provider selection and syncing
Date: Thu, 14 Apr 2022 20:57:53 +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 d1d097c  tests: fix provider selection and syncing
d1d097c is described below

commit d1d097c5bb69230df6d279e4286e7e6a9f0f49f2
Author: Florian Dold <florian@dold.me>
AuthorDate: Thu Apr 14 20:57:46 2022 +0200

    tests: fix provider selection and syncing
---
 ...tasis_reducer_recovery_enter_user_attributes.sh |  1 -
 src/cli/test_anastasis_reducer_recovery_no_pay.sh  | 30 ++++++++++++----------
 2 files changed, 16 insertions(+), 15 deletions(-)

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 4c9c4e9..24cddc3 100755
--- a/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
+++ b/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
@@ -449,7 +449,6 @@ for x in 1 2 3; do
   cat $R1FILE > $R2FILE
 done
 
-CODE=`jq -r -e .code < $R1FILE`
 echo "Providers synced."
 
 
diff --git a/src/cli/test_anastasis_reducer_recovery_no_pay.sh 
b/src/cli/test_anastasis_reducer_recovery_no_pay.sh
index ca78705..e65c526 100755
--- a/src/cli/test_anastasis_reducer_recovery_no_pay.sh
+++ b/src/cli/test_anastasis_reducer_recovery_no_pay.sh
@@ -218,7 +218,7 @@ anastasis-reducer -a '{"provider_url" : 
"http://localhost:8086/"; }' add_provider
 echo " OK"
 
 echo -n "Selecting secret to recover"
-anastasis-reducer -a '{"attribute_mask": 0, "providers" : [ { "version": 0, 
"url" : "http://localhost:8086/"; } ] }' select_version < $R1FILE > $R2FILE
+anastasis-reducer -a '{"attribute_mask": 0, "providers" : [ { "version": 1, 
"url" : "http://localhost:8086/"; } ] }' select_version < $R1FILE > $R2FILE
 
 STATE=`jq -r -e .recovery_state < $R2FILE`
 if test "$STATE" != "CHALLENGE_SELECTING"
@@ -228,19 +228,21 @@ 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!
-
-CODE=`jq -r -e .code < $R1FILE`
-if test "$CODE" != "8420"
-then
-    exit_fail "Expected to be synced, instead the code is '$CODE'"
-fi
-echo " OK"
+# 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
+
+echo "Providers synced."
 
 
 echo -n "Running challenge logic ..."

-- 
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]