diff options
Diffstat (limited to 'tests/run.sh')
-rwxr-xr-x | tests/run.sh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/run.sh b/tests/run.sh index 5d394fc..a78351a 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -16,8 +16,14 @@ curl -u userx:heslox -s http://localhost/auth1 | tee /dev/stderr | grep -F 'REMO curl --data '' -si http://localhost/auth1 | tee /dev/stderr | grep -F 'REMOTE_USER=[]' curl --data 'login=user1&password=heslox' -si http://localhost/auth1 | tee /dev/stderr | grep -F 'REMOTE_USER=[]' curl --data 'login=user1&password=heslo1' -si http://localhost/auth1 | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'login=user1&password=heslo1' | wc -l | grep -q 2 -curl --data 'login=li%C5%A1ka&password=myši+& zaj%c3%adci' -si http://localhost/auth1 | tee /dev/stderr | grep -F 'REMOTE_USER=[]' -curl --data 'login=li%C5%A1ka&password=myši %26%20zaj%c3%adci' -si http://localhost/auth1 | tee /dev/stderr | grep -F -e 'REMOTE_USER=[liška]' -e 'login=li%C5%A1ka&password=myši %26%20zaj%c3%adci' | wc -l | grep -q 2 +NAME='liška' +XNAME='li%c5%a1ka' +if ! getent passwd "$NAME" ; then + NAME=liska + XNAME=$NAME +fi +curl --data "login=$XNAME&password=myši+& zaj%c3%adci" -si http://localhost/auth1 | tee /dev/stderr | grep -F 'REMOTE_USER=[]' +curl --data "login=$XNAME&password=myši %26%20zaj%c3%adci" -si http://localhost/auth1 | tee /dev/stderr | grep -F -e "REMOTE_USER=[$NAME]" -e "login=$XNAME&password=myši %26%20zaj%c3%adci" | wc -l | grep -q 2 curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si http://localhost/auth1 | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'something=somewhere&password=heslo1&something=else&login=user1' | wc -l | grep -q 2 curl --data 'login=user1&password=heslo1' -si http://localhost/auth1r | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'login=user1&password=[REDACTED]' | wc -l | grep -q 2 curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si http://localhost/auth1r | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'something=somewhere&password=[REDACTED]&something=else&login=user1' | wc -l | grep -q 2 @@ -27,7 +33,7 @@ curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si chage -d $(date -d -2days +%Y-%m-%d) -M 1 user1 curl --data 'login=user1&password=heslo1' -si http://localhost/auth1s | tee /dev/stderr | grep -F -e 'HTTP/1.1 307 Temporary Redirect' -e 'Location: http://localhost/login?backurl=http%3a%2f%2flocalhost%2fauth1s&uid=user1' | wc -l | grep -q 2 curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si http://localhost/auth1s | tee /dev/stderr | grep -F -e 'HTTP/1.1 307 Temporary Redirect' -e 'Location: http://localhost/login?backurl=http%3a%2f%2flocalhost%2fauth1s&uid=user1' | wc -l | grep -q 2 -chage -d $(date -d -2days +%Y-%m-%d) -M 1 'liška' -curl --data 'something=somewhere&password=myši+%26%20zaj%C3%adci&something=else&login=liška' -si http://localhost/auth1s | tee /dev/stderr | grep -F -e 'HTTP/1.1 307 Temporary Redirect' -e 'Location: http://localhost/login?backurl=http%3a%2f%2flocalhost%2fauth1s&uid=li%c5%a1ka' | wc -l | grep -q 2 +chage -d $(date -d -2days +%Y-%m-%d) -M 1 "$NAME" +curl --data "something=somewhere&password=myši+%26%20zaj%C3%adci&something=else&login=$NAME" -si http://localhost/auth1s | tee /dev/stderr | grep -F -e 'HTTP/1.1 307 Temporary Redirect' -e "Location: http://localhost/login?backurl=http%3a%2f%2flocalhost%2fauth1s&uid=$XNAME" | wc -l | grep -q 2 echo OK $0. |