test_reclaim_consume.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. trap "gnunet-arm -e -c test_reclaim.conf" SIGINT
  3. LOCATION=$(which gnunet-config)
  4. if [ -z $LOCATION ]
  5. then
  6. LOCATION="gnunet-config"
  7. fi
  8. $LOCATION --version 1> /dev/null
  9. if test $? != 0
  10. then
  11. echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
  12. exit 77
  13. fi
  14. rm -rf `gnunet-config -c test_reclaim.conf -s PATHS -o GNUNET_HOME -f`
  15. # (1) PKEY1.user -> PKEY2.resu.user
  16. # (2) PKEY2.resu -> PKEY3
  17. # (3) PKEY3.user -> PKEY4
  18. which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
  19. TEST_ATTR="test"
  20. gnunet-arm -s -c test_reclaim.conf
  21. #gnunet-arm -i rest -c test_reclaim.conf
  22. gnunet-identity -C testego -c test_reclaim.conf
  23. gnunet-identity -C rpego -c test_reclaim.conf
  24. SUBJECT_KEY=$(gnunet-identity -d -e rpego -q -c test_reclaim.conf)
  25. TEST_KEY=$(gnunet-identity -d -e testego -q -c test_reclaim.conf)
  26. gnunet-reclaim -e testego -a email -V john@doe.gnu -c test_reclaim.conf
  27. gnunet-reclaim -e testego -a name -V John -c test_reclaim.conf
  28. TICKET=$(gnunet-reclaim -e testego -i "email,name" -r $SUBJECT_KEY -c test_reclaim.conf | awk '{print $1}')
  29. gnunet-reclaim -e rpego -C $TICKET -c test_reclaim.conf > /dev/null 2>&1
  30. if test $? != 0
  31. then
  32. "Failed."
  33. exit 1
  34. fi
  35. #curl http://localhost:7776/reclaim/tickets/testego
  36. gnunet-arm -e -c test_reclaim.conf