1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-16 14:27:01 +00:00

dovecot-auth-cli: Test invalid arguments handling

This patch adds a minor test to dovecot-auth-cli to verify that the
check for invalid number of arguments is working as expected.

It's mostly for consistency, as the utility is only used for testing
purposes.
This commit is contained in:
Alberto Bertogli
2021-01-16 14:38:28 +00:00
parent 34b1f6cf21
commit def6e1cee2
2 changed files with 5 additions and 1 deletions

View File

@@ -1,7 +1,6 @@
// CLI used for testing the dovecot authentication package.
//
// NOT for production use.
// +build !coverage
package main

View File

@@ -16,6 +16,11 @@ else
go build $GOFLAGS -tags="$GOTAGS" dovecot-auth-cli.go
fi
if ! ./dovecot-auth-cli lalala 2>&1 | grep -q "invalid arguments"; then
echo "cli worked with invalid arguments"
exit 1
fi
for i in *.cmy; do
if ! chamuyero $i > $i.log 2>&1 ; then
echo "# Test $i failed, log follows"