Files
jira/t/010login.t
T
Cory Bennett 63f41e5e88 add comments
2016-08-10 10:50:04 -07:00

30 lines
967 B
Bash
Executable File

#!/bin/bash
eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)"
cd $(dirname $0)
jira=../jira
PLAN 7
###############################################################################
## Verify logout works, we expect when we call the session api
## that we will get a 401 and prompt user for password
################################################################################
RUNS $jira logout
NRUNS $jira req /rest/auth/1/session </dev/null
ODIFF <<EOF
Jira Password [gojira]:
EOF
###############################################################################
## Verify login works (password read from stdin) and verify that the
## sesion api no longer prompts
###############################################################################
echo "gojira123" | RUNS $jira login
RUNS $jira req /rest/auth/1/session </dev/null
GREP '"name": "gojira"'
GREP '"self": "http://localhost:8080/rest/api/latest/user?username=gojira"'