diff options
Diffstat (limited to 'src/identity/test_identity_messages.sh')
-rwxr-xr-x | src/identity/test_identity_messages.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/identity/test_identity_messages.sh b/src/identity/test_identity_messages.sh index d29d14acc..edb4d5805 100755 --- a/src/identity/test_identity_messages.sh +++ b/src/identity/test_identity_messages.sh | |||
@@ -20,10 +20,21 @@ which timeout >/dev/null 2>&1 && DO_TIMEOUT="timeout 30" | |||
20 | TEST_MSG="This is a test message. 123" | 20 | TEST_MSG="This is a test message. 123" |
21 | gnunet-arm -s -c test_identity.conf | 21 | gnunet-arm -s -c test_identity.conf |
22 | gnunet-identity -C recipientego -c test_identity.conf | 22 | gnunet-identity -C recipientego -c test_identity.conf |
23 | gnunet-identity -C recipientegoed -X -c test_identity.conf | ||
23 | RECIPIENT_KEY=`gnunet-identity -d -e recipientego -q -c test_identity.conf` | 24 | RECIPIENT_KEY=`gnunet-identity -d -e recipientego -q -c test_identity.conf` |
24 | MSG_ENC=`gnunet-identity -W "$TEST_MSG" -k $RECIPIENT_KEY -c test_identity.conf` | 25 | MSG_ENC=`gnunet-identity -W "$TEST_MSG" -k $RECIPIENT_KEY -c test_identity.conf` |
25 | MSG_DEC=`gnunet-identity -R "$MSG_ENC" -e recipientego -c test_identity.conf` | 26 | if [ $? == 0 ] |
27 | then | ||
28 | MSG_DEC=`gnunet-identity -R "$MSG_ENC" -e recipientego -c test_identity.conf` | ||
29 | fi | ||
30 | RECIPIENT_KEY_ED=`gnunet-identity -d -e recipientegoed -q -c test_identity.conf` | ||
31 | MSG_ENC_ED=`gnunet-identity -W "$TEST_MSG" -k $RECIPIENT_KEY_ED -c test_identity.conf` | ||
32 | if [ $? == 0 ] | ||
33 | then | ||
34 | MSG_DEC_ED=`gnunet-identity -R "$MSG_ENC_ED" -e recipientegoed -c test_identity.conf` | ||
35 | fi | ||
26 | gnunet-identity -D recipientego -c test_identity.conf | 36 | gnunet-identity -D recipientego -c test_identity.conf |
37 | gnunet-identity -D recipientegoed -c test_identity.conf | ||
27 | gnunet-arm -e -c test_identity.conf | 38 | gnunet-arm -e -c test_identity.conf |
28 | if [ "$TEST_MSG" != "$MSG_DEC" ] | 39 | if [ "$TEST_MSG" != "$MSG_DEC" ] |
29 | then | 40 | then |
@@ -31,5 +42,9 @@ then | |||
31 | echo "Failed - \"$TEST_MSG\" != \"$MSG_DEC\"" | 42 | echo "Failed - \"$TEST_MSG\" != \"$MSG_DEC\"" |
32 | exit 1 | 43 | exit 1 |
33 | fi | 44 | fi |
34 | 45 | if [ "$TEST_MSG" != "$MSG_DEC_ED" ] | |
35 | 46 | then | |
47 | diff <(echo "$TEST_MSG" ) <(echo "$MSG_DEC_ED") | ||
48 | echo "Failed - \"$TEST_MSG\" != \"$MSG_DEC_ED\"" | ||
49 | exit 1 | ||
50 | fi | ||