3 #First, start gnunet-arm and the rest-service.
4 #Exit 0 means success, exit 1 means failed test
6 gns_link="http://localhost:7776/gns"
7 wrong_link="http://localhost:7776/gnsandmore"
12 cache="$(curl -v "$1" 2>&1 | grep "$2")"
20 gnunet-identity -D "test_plugin_rest_gns" > /dev/null 2>&1
22 curl_get "$gns_link/www.test_plugin_rest_gns" "error"
24 gnunet-identity -C "test_plugin_rest_gns"
26 curl_get "$gns_link/www.test_plugin_rest_gns" "\[\]"
28 gnunet-namestore -z "test_plugin_rest_gns" -p -a -n www -e 1d -V 1.1.1.1 -t A
30 curl_get "$gns_link/www.test_plugin_rest_gns" "1.1.1.1"
32 gnunet-namestore -z "test_plugin_rest_gns" -p -a -n www -e 1d -V 1::1 -t AAAA
34 curl_get "$gns_link/www.test_plugin_rest_gns" "1::1.*1.1.1.1"
36 gnunet-namestore -z "test_plugin_rest_gns" -p -a -n www -e 1d -V 1.1.1.2 -t A
38 curl_get "$gns_link/www.test_plugin_rest_gns" "1.1.1.2.*1::1.*1.1.1.1"
39 curl_get "$gns_link/www.test_plugin_rest_gns?record_type=A" "1.1.1.2.*1.1.1.1"
40 curl_get "$gns_link/www.test_plugin_rest_gns?record_type=AAAA" "1::1"
41 curl_get "$gns_link/www.test_plugin_rest_gns?record_type=WRONG_TYPE" "1.1.1.2.*1::1.*1.1.1.1"
43 gnunet-namestore -z "test_plugin_rest_gns" -p -a -n www1 -e 1d -V 1.1.1.1 -t A
44 curl_get "$gns_link/www1.test_plugin_rest_gns" "1.1.1.1"
46 gnunet-identity -D "test_plugin_rest_gns" > /dev/null 2>&1
48 curl_get "$gns_link/www1.test_plugin_rest_gns" "error"