git » chasquid » commit 605e39d

test: Extend chasquid-util aliases-add tests

author Alberto Bertogli
2019-10-19 10:54:01 UTC
committer Alberto Bertogli
2019-10-19 12:06:30 UTC
parent 8d910fc84d3751e69ea74c2a4f9d222007808f08

test: Extend chasquid-util aliases-add tests

cmd/chasquid-util/test.sh +14 -4

diff --git a/cmd/chasquid-util/test.sh b/cmd/chasquid-util/test.sh
index 57d251c..dc0e2c1 100755
--- a/cmd/chasquid-util/test.sh
+++ b/cmd/chasquid-util/test.sh
@@ -81,12 +81,22 @@ if [ "$C" != "hostname: \"$HOSTNAME\"" ]; then
 fi
 
 if r aliases-add alias2@domain target > /dev/null; then
-	ALIAS=$(grep alias2 .config/domains/domain/aliases)
-	if [ "$ALIAS" != "alias2: target" ]; then
-		echo alias-add failed
-		echo output: "$ALIAS"
+	A=$(grep alias2 .config/domains/domain/aliases)
+	if [ "$A" != "alias2: target" ]; then
+		echo aliases-add failed
+		echo output: "$A"
 		exit 1
 	fi
 fi
 
+if r aliases-add alias2@domain target > /dev/null; then
+	echo aliases-add on existing alias worked
+	exit 1
+fi
+
+if r aliases-add alias3@notexist target > /dev/null; then
+	echo aliases-add on non-existing domain worked
+	exit 1
+fi
+
 success