aboutsummaryrefslogtreecommitdiff
path: root/src/revocation
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-11-26 12:09:21 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-11-26 12:09:21 +0000
commitfa05c4a3e2371239b7c80a04fdf551b19845f2a6 (patch)
treeed4c2652056657a282a9925aae6e702f3d46b817 /src/revocation
parentcbeca30479037a3b95e779cffe858fe9fe028290 (diff)
downloadgnunet-fa05c4a3e2371239b7c80a04fdf551b19845f2a6.tar.gz
gnunet-fa05c4a3e2371239b7c80a04fdf551b19845f2a6.zip
local revocation test
Diffstat (limited to 'src/revocation')
-rw-r--r--src/revocation/Makefile.am6
-rwxr-xr-xsrc/revocation/test_local_revocation.sh27
-rw-r--r--src/revocation/test_revocation.conf12
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 = \
56gnunet_service_revocation_DEPENDENCIES = \ 56gnunet_service_revocation_DEPENDENCIES = \
57 libgnunetrevocation.la 57 libgnunetrevocation.la
58 58
59check_SCRIPTS = \
60 test_local_revocation.sh
61
62if ENABLE_TEST_RUN
63 TESTS = $(check_SCRIPTS)
64endif
59 65
60EXTRA_DIST = test_revocation.conf 66EXTRA_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
2TEST_CONFIGURATION="test_revocation.conf"
3TEST_REVOCATION_EGO="revoc_test"
4
5which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
6trap "gnunet-arm -e -c test_revocation.conf" SIGINT
7
8# clean up
9rm -rf `gnunet-config -c test_revocation.conf -s PATHS -o GNUNET_HOME -f`
10
11# Start
12gnunet-arm -s -c $TEST_CONFIGURATION
13gnunet-identity -C $TEST_REVOCATION_EGO -c $TEST_CONFIGURATION
14TEST_REVOCATION_KEY=$(gnunet-identity -d | awk '{split($0,a," "); print a[3]}')
15
16echo Testing key $TEST_REVOCATION_KEY
17OUTPUT_NOT_REVOKED=$(gnunet-revocation -t $TEST_REVOCATION_KEY -c $TEST_CONFIGURATION )
18
19echo Revoking key $TEST_REVOCATION_KEY
20gnunet-revocation -R $TEST_REVOCATION_EGO -p -c $TEST_CONFIGURATION 1> /dev/null 2> /dev/null
21
22echo Testing revoked key $TEST_REVOCATION_KEY
23OUTPUT_REVOKED=$(gnunet-revocation -t $TEST_REVOCATION_KEY -c $TEST_CONFIGURATION)
24
25#clean up
26gnunet-arm -e -c test_revocation.conf
27rm -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]
2GNUNET_HOME=/tmp/test-revocation-service
3SERVICEHOME=/tmp/test-revocation-service
4
1[revocation] 5[revocation]
2WORKBITS = 5 6WORKBITS = 5
7
8[identity]
9# Directory where we store information about our egos
10EGODIR = $GNUNET_HOME/identity/egos/
11SUBSYSTEM_CFG = $SERVICEHOME/s.conf
12
13[hostlist]
14SERVER = dummy \ No newline at end of file