commit 5ea0f07339abdca04b8bed6253b1940171c9f10e parent 6c119818deba8524d848d79eb7540f24ed04e1eb Author: rexxnor <rexxnor+gnunet@brief.li> Date: Sun, 20 Jan 2019 14:46:29 +0100 renamed files Diffstat:
| A | ascension/test/test_ascension_simple.sh | | | 85 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| D | ascension/test/test_gnsmigrator_simple.sh | | | 99 | ------------------------------------------------------------------------------- |
| R | ascension/test/test_unit_gnsmigrator.py -> ascension/test/test_unit_ascension.py | | | 0 |
3 files changed, 85 insertions(+), 99 deletions(-)
diff --git a/ascension/test/test_ascension_simple.sh b/ascension/test/test_ascension_simple.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# Author: rexxnor +# Returns 1 on basic error +# Returns 2 on explicit test case errors +# Returns 3 on implicit test case errors + +# Shutdown named +function cleanup { + pkill named + gnunet-identity -D gnunet + gnunet-identity -D org +} + +# Check for required packages + +if ! [ -x "$(command -v named)" ]; then + echo 'bind/named is not installed' >&2 + exit 1 +fi + +if ! [ -x "$(command -v ascension)" ]; then + echo 'ascension is not installed' >&2 + exit 1 +fi + +# Start named with a simple zone +named -c basic_named.conf -p 5000 + +# Check if domain resolves +nslookup gnunet.org 127.0.0.1 -port=5000 +if [ "$?" -ne 0 ]; then + echo "Something went wrong with named" + cleanup + exit 1 +fi + +# Let ascension run on gnunet.org test domain +ascension gnunet.org -ns 127.0.0.1 -p 5000 +if [ "$?" -ne 0 ]; then + echo "ascension failed adding the records!" + cleanup + exit 1 +fi + +function checkfailexp { + if [ "$?" -ne 0 ]; then + echo "required record not present" + cleanup + exit 2 + fi +} + +function checkfailimp { + if [ "$?" -ne 0 ]; then + echo "implied record not present" + cleanup + exit 3 + fi +} + +# TESTING explicit records +gnunet-gns -t CNAME -u asdf.gnunet +checkfailexp +gnunet-gns -t AAAA -u foo.gnunet +checkfailexp +gnunet-gns -t A -u mail.gnunet +checkfailexp +gnunet-gns -t A -u ns1.gnunet +checkfailexp +gnunet-gns -t A -u ns2.gnunet +checkfailexp +gnunet-gns -t A -u ns2.gnunet.org +checkfailexp +gnunet-gns -t MX -u mail.gnunet +checkfailexp +gnunet-gns -t A -u nextcloud.gnunet +checkfailexp +gnunet-gns -t SOA -u @.gnunet +checkfailexp + +# cleanup if we get this far +cleanup + +# finish +echo "All records added successfully!!" diff --git a/ascension/test/test_gnsmigrator_simple.sh b/ascension/test/test_gnsmigrator_simple.sh @@ -1,99 +0,0 @@ -#!/bin/bash -# Author: rexxnor -# Returns 1 on basic error -# Returns 2 on explicit test case errors -# Returns 3 on implicit test case errors - -# Shutdown named -function cleanup { - pkill named - gnunet-identity -D gnunet - gnunet-identity -D org -} - -# Check for required packages - -if ! [ -x "$(command -v named)" ]; then - echo 'bind/named is not installed' >&2 - exit 1 -fi - -if ! [ -x "$(command -v ascension)" ]; then - echo 'ascension is not installed' >&2 - exit 1 -fi - -# Start named with a simple zone -named -c basic_named.conf -p 5000 - -# Check if domain resolves -nslookup gnunet.org 127.0.0.1 -port=5000 -if [ "$?" -ne 0 ]; then - echo "Something went wrong with named" - cleanup - exit 1 -fi - -# Let ascension run on gnunet.org test domain -ascension gnunet.org -ns 127.0.0.1 -p 5000 -if [ "$?" -ne 0 ]; then - echo "ascension failed adding the records!" - cleanup - exit 1 -fi - -function checkfailexp { - if [ "$?" -ne 0 ]; then - echo "required record not present" - cleanup - exit 2 - fi -} - -function checkfailimp { - if [ "$?" -ne 0 ]; then - echo "implied record not present" - cleanup - exit 3 - fi -} - -# TESTING explicit records -gnunet-gns -t CNAME -u asdf.gnunet -checkfailexp -gnunet-gns -t AAAA -u foo.gnunet -checkfailexp -gnunet-gns -t A -u mail.gnunet -checkfailexp -gnunet-gns -t A -u ns1.gnunet -checkfailexp -gnunet-gns -t A -u ns2.gnunet -checkfailexp -gnunet-gns -t A -u ns2.gnunet.org -checkfailexp -gnunet-gns -t MX -u mail.gnunet -checkfailexp -gnunet-gns -t A -u nextcloud.gnunet -checkfailexp -gnunet-gns -t SOA -u @.gnunet -checkfailexp - -# TESTING implicit records -gnunet-gns -t LEHO -u foo.gnunet -checkfailimp -gnunet-gns -t LEHO -u mail.gnunet -checkfailimp -gnunet-gns -t LEHO -u nextcloud.gnunet -checkfailimp -gnunet-gns -t LEHO -u owncloud.gnunet -checkfailimp -gnunet-gns -t LEHO -u ns1.gnunet -checkfailimp -gnunet-gns -t LEHO -u ns2.gnunet -checkfailimp - -# cleanup if we get this far -cleanup - -# finish -echo "All records added successfully!!" diff --git a/ascension/test/test_unit_gnsmigrator.py b/ascension/test/test_unit_ascension.py