tests: verify correct operation with locked account

That checks whether connecting to a locked account will have
unexpected effects (e.g., login allowed).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2017-08-23 09:26:55 +02:00
parent 4fcea8ae06
commit 5d74492a59
3 changed files with 10 additions and 1 deletions

View File

@@ -5,6 +5,8 @@
auth = "plain[@SRCDIR@/data/test1.passwd]"
#auth = "pam"
max-ban-score = 0
# A banner to be displayed on clients
#banner = "Welcome"

View File

@@ -5,3 +5,4 @@ test3:*:$5$d24yO9edrMd5ISka$/77d6DRK4fhdbTAecc4V8mmnQXSOU4Qn4zZQhOVaEqC
test4:*:$5$5Hzjz2RPxM70vXiH$lCAFmGx77MNcauzf30.HJlKWm8dwVNiut.nyZyQRndC
test5:*:$5$nvA.6.RBPqZg16K2$WAEXw7MJaSUj/Nwosu54JfqxMDlkZnrG.0/rsxl276C
empty:*:$5$tScKhdO1ZcJ0GmmQ$rw095k.ThqbeQ60N06efHnAOibV/GoW5cRZKyHr8jd2
locked:tost,group1, group2 , group3:!$5$i6SNmLDCgBNjyJ7q$SZ4bVJb7I/DLgXo3txHBVohRFBjOtdbxGQZp.DOnrA.

View File

@@ -43,9 +43,15 @@ echo "Connecting to obtain cookie with wrong username... "
( echo "tost" | LD_PRELOAD=libsocket_wrapper.so $OPENCONNECT -q $ADDRESS:$PORT -u tost --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) &&
fail $PID "Received cookie when we shouldn't"
# test locked account
echo "Connecting to obtain cookie with locked account... "
( echo "test" | LD_PRELOAD=libsocket_wrapper.so $OPENCONNECT -q $ADDRESS:$PORT -u locked --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) &&
fail $PID "Received cookie when we shouldn't"
#test special characters
echo "Connecting to obtain cookie... "
echo "Connecting to obtain cookie with special password... "
( echo "!@#$%^&*()<>" | LD_PRELOAD=libsocket_wrapper.so $OPENCONNECT -q $ADDRESS:$PORT -u "sp@c/al" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) ||
fail $PID "Could not receive cookie from server"