diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-11-26 12:09:21 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-11-26 12:09:21 +0000 |
commit | fa05c4a3e2371239b7c80a04fdf551b19845f2a6 (patch) | |
tree | ed4c2652056657a282a9925aae6e702f3d46b817 /src/revocation | |
parent | cbeca30479037a3b95e779cffe858fe9fe028290 (diff) | |
download | gnunet-fa05c4a3e2371239b7c80a04fdf551b19845f2a6.tar.gz gnunet-fa05c4a3e2371239b7c80a04fdf551b19845f2a6.zip |
local revocation test
Diffstat (limited to 'src/revocation')
-rw-r--r-- | src/revocation/Makefile.am | 6 | ||||
-rwxr-xr-x | src/revocation/test_local_revocation.sh | 27 | ||||
-rw-r--r-- | src/revocation/test_revocation.conf | 12 |
3 files changed, 45 insertions, 0 deletions
diff --git a/src/revocation/Makefile.am b/src/revocation/Makefile.am index 81af152bd..02e10c77d 100644 --- a/src/revocation/Makefile.am +++ b/src/revocation/Makefile.am | |||
@@ -56,6 +56,12 @@ gnunet_service_revocation_LDADD = \ | |||
56 | gnunet_service_revocation_DEPENDENCIES = \ | 56 | gnunet_service_revocation_DEPENDENCIES = \ |
57 | libgnunetrevocation.la | 57 | libgnunetrevocation.la |
58 | 58 | ||
59 | check_SCRIPTS = \ | ||
60 | test_local_revocation.sh | ||
61 | |||
62 | if ENABLE_TEST_RUN | ||
63 | TESTS = $(check_SCRIPTS) | ||
64 | endif | ||
59 | 65 | ||
60 | EXTRA_DIST = test_revocation.conf | 66 | EXTRA_DIST = test_revocation.conf |
61 | 67 | ||
diff --git a/src/revocation/test_local_revocation.sh b/src/revocation/test_local_revocation.sh new file mode 100755 index 000000000..8661a2583 --- /dev/null +++ b/src/revocation/test_local_revocation.sh | |||
@@ -0,0 +1,27 @@ | |||
1 | #!/bin/bash | ||
2 | TEST_CONFIGURATION="test_revocation.conf" | ||
3 | TEST_REVOCATION_EGO="revoc_test" | ||
4 | |||
5 | which timeout &> /dev/null && DO_TIMEOUT="timeout 5" | ||
6 | trap "gnunet-arm -e -c test_revocation.conf" SIGINT | ||
7 | |||
8 | # clean up | ||
9 | rm -rf `gnunet-config -c test_revocation.conf -s PATHS -o GNUNET_HOME -f` | ||
10 | |||
11 | # Start | ||
12 | gnunet-arm -s -c $TEST_CONFIGURATION | ||
13 | gnunet-identity -C $TEST_REVOCATION_EGO -c $TEST_CONFIGURATION | ||
14 | TEST_REVOCATION_KEY=$(gnunet-identity -d | awk '{split($0,a," "); print a[3]}') | ||
15 | |||
16 | echo Testing key $TEST_REVOCATION_KEY | ||
17 | OUTPUT_NOT_REVOKED=$(gnunet-revocation -t $TEST_REVOCATION_KEY -c $TEST_CONFIGURATION ) | ||
18 | |||
19 | echo Revoking key $TEST_REVOCATION_KEY | ||
20 | gnunet-revocation -R $TEST_REVOCATION_EGO -p -c $TEST_CONFIGURATION 1> /dev/null 2> /dev/null | ||
21 | |||
22 | echo Testing revoked key $TEST_REVOCATION_KEY | ||
23 | OUTPUT_REVOKED=$(gnunet-revocation -t $TEST_REVOCATION_KEY -c $TEST_CONFIGURATION) | ||
24 | |||
25 | #clean up | ||
26 | gnunet-arm -e -c test_revocation.conf | ||
27 | rm -rf `gnunet-config -c test_revocation.conf -s PATHS -o GNUNET_HOME -f` | ||
diff --git a/src/revocation/test_revocation.conf b/src/revocation/test_revocation.conf index b11a9ddcd..43bf698b7 100644 --- a/src/revocation/test_revocation.conf +++ b/src/revocation/test_revocation.conf | |||
@@ -1,2 +1,14 @@ | |||
1 | [paths] | ||
2 | GNUNET_HOME=/tmp/test-revocation-service | ||
3 | SERVICEHOME=/tmp/test-revocation-service | ||
4 | |||
1 | [revocation] | 5 | [revocation] |
2 | WORKBITS = 5 | 6 | WORKBITS = 5 |
7 | |||
8 | [identity] | ||
9 | # Directory where we store information about our egos | ||
10 | EGODIR = $GNUNET_HOME/identity/egos/ | ||
11 | SUBSYSTEM_CFG = $SERVICEHOME/s.conf | ||
12 | |||
13 | [hostlist] | ||
14 | SERVER = dummy \ No newline at end of file | ||