[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: resources to contrib
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: resources to contrib |
Date: |
Tue, 22 Dec 2020 14:19:54 +0100 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 2a29519 resources to contrib
2a29519 is described below
commit 2a29519fce36c5627eb040ea14c1d16fde037926
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Tue Dec 22 14:19:47 2020 +0100
resources to contrib
---
contrib/Makefile.am | 9 +++++++-
.../test_anastasis_reducer_add_authentication.sh | 16 ++++++-------
.../test_anastasis_reducer_done_authentication.sh | 18 +++++++--------
.../test_anastasis_reducer_done_policy_review.sh | 18 +++++++--------
src/cli/test_anastasis_reducer_enter_secret.sh | 27 ++++++----------------
...test_anastasis_reducer_enter_user_attributes.sh | 17 +++++++-------
src/cli/test_anastasis_reducer_select_country.sh | 7 ++----
7 files changed, 51 insertions(+), 61 deletions(-)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index c82cb24..6bc6124 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -14,4 +14,11 @@ pkgdata_DATA = \
redux.de.json \
redux.us.json \
redux.countries.json \
- provider-list.json
+ provider-list.json \
+ test_resources/test_reducer_stateBFSTATE \
+ test_resources/test_reducer_statePPSTATE \
+ test_resources/test_reducer_stateUACSTATE \
+ test_resources/test_reducer_stateSESTATE \
+ test_resources/test_reducer_statePRSTATE \
+ test_resources/test_reducer_stateAESTATE \
+ test_resources/test_reducer_stateAESTATE_FINAL
diff --git a/src/cli/test_anastasis_reducer_add_authentication.sh
b/src/cli/test_anastasis_reducer_add_authentication.sh
index 6968e39..0ec7922 100755
--- a/src/cli/test_anastasis_reducer_add_authentication.sh
+++ b/src/cli/test_anastasis_reducer_add_authentication.sh
@@ -26,12 +26,12 @@ function cleanup()
}
# Install cleanup handler (except for kill -9)
+AFN=`which anastasis-reducer`
+ADN=`dirname $AFN`
+RESOURCES=$ADN/../share/anastasis
SFILE=`mktemp test_reducer_stateXXXXXX`
TFILE=`mktemp test_reducer_stateXXXXXX`
-UFILE=resources/test_reducer_stateAESTATE
-# Tempfile used by other test
-VFILE=resources/test_reducer_stateAESTATE_FINAL
-
+UFILE=$RESOURCES/test_reducer_stateAESTATE
trap cleanup EXIT
@@ -91,8 +91,6 @@ then
fi
#Third method
-mkdir -p resources
-touch $VFILE
./anastasis-reducer -a \
'{"authentication_method": {
"method": "question",
@@ -100,15 +98,15 @@ touch $VFILE
"question": "Where do you live?",
"answer": "Mars"
}}}' \
- add_authentication $TFILE $VFILE
+ add_authentication $TFILE $SFILE
-STATE=`jq -r -e .backup_state < $VFILE`
+STATE=`jq -r -e .backup_state < $SFILE`
if test "$STATE" != "AUTHENTICATIONS_EDITING"
then
exit_fail "Expected new state to be AUTHENTICATIONS_EDITING, got $STATE"
fi
-ARRAY_LENGTH=`jq -r -e '.authentication_methods | length' < $VFILE`
+ARRAY_LENGTH=`jq -r -e '.authentication_methods | length' < $SFILE`
if test $ARRAY_LENGTH != 3
then
exit_fail "Expected array length to be 3, got $ARRAY_LENGTH"
diff --git a/src/cli/test_anastasis_reducer_done_authentication.sh
b/src/cli/test_anastasis_reducer_done_authentication.sh
index b85ced1..861d3e5 100755
--- a/src/cli/test_anastasis_reducer_done_authentication.sh
+++ b/src/cli/test_anastasis_reducer_done_authentication.sh
@@ -21,14 +21,16 @@ function cleanup()
do
kill $n 2> /dev/null || true
done
+ rm -f $TFILE
wait
}
# Install cleanup handler (except for kill -9)
-UFILE=resources/test_reducer_stateAESTATE_FINAL
-# Tempfile used by other test
-VFILE=resources/test_reducer_statePRSTATE
-
+AFN=`which anastasis-reducer`
+ADN=`dirname $AFN`
+RESOURCES=$ADN/../share/anastasis
+SFILE=$RESOURCES/test_reducer_stateAESTATE_FINAL
+TFILE=`mktemp test_reducer_stateXXXXXX`
trap cleanup EXIT
@@ -43,19 +45,17 @@ echo "Beginning with actual reducer test"
# Test done authentication in a backup state
echo " "
echo "Test done authentication (next) in a backup state"
-mkdir -p resources
-touch $VFILE
./anastasis-reducer -a \
'{}' \
- next $UFILE $VFILE
+ next $SFILE $TFILE
-STATE=`jq -r -e .backup_state < $VFILE`
+STATE=`jq -r -e .backup_state < $TFILE`
if test "$STATE" != "POLICIES_REVIEWING"
then
exit_fail "Expected new state to be AUTHENTICATIONS_EDITING, got $STATE"
fi
-ARRAY_LENGTH=`jq -r -e '.policies | length' < $VFILE`
+ARRAY_LENGTH=`jq -r -e '.policies | length' < $TFILE`
if test $ARRAY_LENGTH -lt 3
then
exit_fail "Expected policy array length to be >= 3, got $ARRAY_LENGTH"
diff --git a/src/cli/test_anastasis_reducer_done_policy_review.sh
b/src/cli/test_anastasis_reducer_done_policy_review.sh
index 963fcc3..0077dab 100755
--- a/src/cli/test_anastasis_reducer_done_policy_review.sh
+++ b/src/cli/test_anastasis_reducer_done_policy_review.sh
@@ -21,14 +21,16 @@ function cleanup()
do
kill $n 2> /dev/null || true
done
+ rm -f $TFILE
wait
}
# Install cleanup handler (except for kill -9)
-UFILE=resources/test_reducer_statePRSTATE
-# Tempfile used by other test
-VFILE=resources/test_reducer_stateSESTATE
-
+AFN=`which anastasis-reducer`
+ADN=`dirname $AFN`
+RESOURCES=$ADN/../share/anastasis
+SFILE=$RESOURCES/test_reducer_statePRSTATE
+TFILE=`mktemp test_reducer_stateXXXXXX`
trap cleanup EXIT
@@ -43,19 +45,17 @@ echo "Beginning with actual reducer test"
# Test done policy review in a backup state
echo " "
echo "Test done policy review (next) in a backup state"
-mkdir -p resources
-touch $VFILE
./anastasis-reducer -a \
'{}' \
- next $UFILE $VFILE
+ next $SFILE $TFILE
-STATE=`jq -r -e .backup_state < $VFILE`
+STATE=`jq -r -e .backup_state < $TFILE`
if test "$STATE" != "SECRET_EDITING"
then
exit_fail "Expected new state to be SECRET_EDITING, got $STATE"
fi
-ARRAY_LENGTH=`jq -r -e '.truths | length' < $VFILE`
+ARRAY_LENGTH=`jq -r -e '.truths | length' < $TFILE`
if test $ARRAY_LENGTH -lt 3
then
exit_fail "Expected truths array length to be >= 3, got $ARRAY_LENGTH"
diff --git a/src/cli/test_anastasis_reducer_enter_secret.sh
b/src/cli/test_anastasis_reducer_enter_secret.sh
index edd283a..d049f97 100755
--- a/src/cli/test_anastasis_reducer_enter_secret.sh
+++ b/src/cli/test_anastasis_reducer_enter_secret.sh
@@ -26,12 +26,15 @@ function cleanup()
do
kill $n 2> /dev/null || true
done
- rm -f $CONF $CONF_1 $CONF_2 $CONF_3 $CONF_4 $WALLET_DB
+ rm -f $CONF $CONF_1 $CONF_2 $CONF_3 $CONF_4 $WALLET_DB $TFILE $UFILE
rm -r $TMP_DIR
wait
}
# Install cleanup handler (except for kill -9)
+AFN=`which anastasis-reducer`
+ADN=`dirname $AFN`
+RESOURCES=$ADN/../share/anastasis
TMP_DIR=`mktemp -d keys-tmp-XXXXXX`
WALLET_DB=`mktemp test_reducer_walletXXXXXX.json`
CONF=`mktemp test_reducerXXXXXX.conf`
@@ -39,9 +42,9 @@ CONF_1=`mktemp test_reducerXXXXXX_1.conf`
CONF_2=`mktemp test_reducerXXXXXX_2.conf`
CONF_3=`mktemp test_reducerXXXXXX_3.conf`
CONF_4=`mktemp test_reducerXXXXXX_4.conf`
-SFILE=resources/test_reducer_stateSESTATE
-TFILE=resources/test_reducer_statePPSTATE
-UFILE=resources/test_reducer_stateBFSTATE
+SFILE=$RESOURCES/test_reducer_stateSESTATE
+TFILE=`mktemp test_reducer_statePPXXXXXX`
+UFILE=`mktemp test_reducer_stateBFXXXXXX`
trap cleanup EXIT
@@ -66,19 +69,6 @@ echo -n "Testing for anastasis-httpd"
anastasis-httpd -h >/dev/null </dev/null || exit_skip " MISSING"
echo " FOUND"
-if [ -e $SFILE ]
-then
- echo " "
- echo "Resources existing"
-else
- echo " "
- echo "Resources not existing..."
- echo "Setting up resources..."
- # run other tests before to set up resources
- make check
- echo "Resources created"
-fi
-
# Name of the Postgres database we will use for the script.
# Will be dropped, do NOT use anything that might be used
# elsewhere
@@ -278,8 +268,6 @@ echo -e $COLOR$BOLD"Beginning with actual reducer
test"$NORM$NOCOLOR
# Test enter secret in a backup state
echo " "
echo -e $COLOR$BOLD"Test enter secret in a backup state"$NORM$NOCOLOR
-mkdir -p resources
-touch $TFILE
valgrind .libs/anastasis-reducer -a \
'{"secret": "veryhardtoguesssecret",
"type": "password"}' \
@@ -340,7 +328,6 @@ echo -e $COLOR$BOLD"Payment done"$NORM$NOCOLOR
echo " "
echo " "
echo -e $COLOR$BOLD"Try to upload again"$NORM$NOCOLOR
-touch $UFILE
valgrind .libs/anastasis-reducer -a \
'{}' \
pay $TFILE $UFILE
diff --git a/src/cli/test_anastasis_reducer_enter_user_attributes.sh
b/src/cli/test_anastasis_reducer_enter_user_attributes.sh
index 1cf50aa..756cd1c 100755
--- a/src/cli/test_anastasis_reducer_enter_user_attributes.sh
+++ b/src/cli/test_anastasis_reducer_enter_user_attributes.sh
@@ -21,13 +21,16 @@ function cleanup()
do
kill $n 2> /dev/null || true
done
+ rm -f $TFILE
wait
}
# Install cleanup handler (except for kill -9)
-UFILE=resources/test_reducer_stateUACSTATE
-# Tempfile used other test
-VFILE=resources/test_reducer_stateAESTATE
+AFN=`which anastasis-reducer`
+ADN=`dirname $AFN`
+RESOURCES=$ADN/../share/anastasis
+SFILE=$RESOURCES/test_reducer_stateUACSTATE
+TFILE=`mktemp test_reducer_stateXXXXXX`
trap cleanup EXIT
@@ -42,8 +45,6 @@ echo "Beginning with actual reducer test"
# Test user attributes collection in a backup state
echo " "
echo "Test user attributes collection in a backup state"
-mkdir -p resources
-touch $VFILE
./anastasis-reducer -a \
'{"identity_attributes": {
"full_name": "Max Musterman",
@@ -51,15 +52,15 @@ touch $VFILE
"birth_year": 2000 ,
"birth_month": 1,
"birth_day": 1}}' \
- enter_user_attributes $UFILE $VFILE
+ enter_user_attributes $SFILE $TFILE
-STATE=`jq -r -e .backup_state < $VFILE`
+STATE=`jq -r -e .backup_state < $TFILE`
if test "$STATE" != "AUTHENTICATIONS_EDITING"
then
exit_fail "Expected new state to be AUTHENTICATIONS_EDITING, got $STATE"
fi
-SELECTED_COUNTRY=`jq -r -e .selected_country < $VFILE`
+SELECTED_COUNTRY=`jq -r -e .selected_country < $TFILE`
if test "$SELECTED_COUNTRY" != "ch"
then
exit_fail "Expected selected country to be ch, got $SELECTED_COUNTRY"
diff --git a/src/cli/test_anastasis_reducer_select_country.sh
b/src/cli/test_anastasis_reducer_select_country.sh
index 03a79ff..a0300e6 100755
--- a/src/cli/test_anastasis_reducer_select_country.sh
+++ b/src/cli/test_anastasis_reducer_select_country.sh
@@ -21,7 +21,7 @@ function cleanup()
do
kill $n 2> /dev/null || true
done
- rm -f $SFILE $TFILE $CONF_1 $CONF_2 $CONF_3 $CONF_4
+ rm -f $SFILE $TFILE $UFILE $CONF_1 $CONF_2 $CONF_3 $CONF_4
wait
}
@@ -32,8 +32,7 @@ CONF_3=`mktemp test_reducerXXXXXX_3.conf`
CONF_4=`mktemp test_reducerXXXXXX_4.conf`
SFILE=`mktemp test_reducer_stateXXXXXX`
TFILE=`mktemp test_reducer_stateXXXXXX`
-# Tempfile used by other test
-UFILE=resources/test_reducer_stateUACSTATE
+UFILE=`mktemp test_reducer_stateXXXXXX`
trap cleanup EXIT
@@ -113,8 +112,6 @@ echo " "
echo "Test country selection in a backup state"
./anastasis-reducer -b $SFILE
./anastasis-reducer -a '{"continent": "Europe"}' select_continent $SFILE $TFILE
-mkdir -p resources
-touch $UFILE
./anastasis-reducer -a \
'{"country": "Switzerland",
"country_code": "ch",
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: resources to contrib,
gnunet <=