diff options
Diffstat (limited to 'src/cli/namestore/test_namestore_zonefile_import.sh')
-rwxr-xr-x | src/cli/namestore/test_namestore_zonefile_import.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/cli/namestore/test_namestore_zonefile_import.sh b/src/cli/namestore/test_namestore_zonefile_import.sh new file mode 100755 index 000000000..d6345257f --- /dev/null +++ b/src/cli/namestore/test_namestore_zonefile_import.sh | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/bin/sh | ||
2 | # This file is in the public domain. | ||
3 | trap "gnunet-arm -e -c test_namestore_api.conf" INT | ||
4 | |||
5 | LOCATION=$(which gnunet-config) | ||
6 | if [ -z $LOCATION ] | ||
7 | then | ||
8 | LOCATION="gnunet-config" | ||
9 | fi | ||
10 | $LOCATION --version 1> /dev/null | ||
11 | if test $? != 0 | ||
12 | then | ||
13 | echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" | ||
14 | exit 77 | ||
15 | fi | ||
16 | |||
17 | rm -rf `gnunet-config -c test_namestore_api.conf -f -s paths -o GNUNET_TEST_HOME` | ||
18 | which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5" | ||
19 | |||
20 | MY_EGO="myego" | ||
21 | gnunet-arm -s -c test_namestore_api.conf | ||
22 | gnunet-identity -C $MY_EGO -c test_namestore_api.conf | ||
23 | gnunet-namestore-zonefile -c test_namestore_api.conf < example_zonefile | ||
24 | res=$? | ||
25 | gnunet-identity -D $MY_EGO -c test_namestore_api.conf | ||
26 | gnunet-arm -e -c test_namestore_api.conf | ||
27 | |||
28 | if [ $res != 0 ]; then | ||
29 | echo "FAIL: Zone import failed." | ||
30 | exit 1 | ||
31 | fi | ||
32 | |||
33 | |||