...
To explore or test new features I suggest Atlassian's RAB for exploratory testing.
Image Added
Scripted / Regression testing
I recommend Resty, its lightweight and easy - https://github.com/micha/resty
Expand |
---|
title | Click here to expand sample test script... |
---|
|
Code Block |
---|
#!/bin/bash
#
#
# This script calls the token create endpoint and then disabled and re-enables an agent before deleting its token
# Only a smoke test, for comprehensive tests see the src/test folders
#
#update these as needed, or pass as arguments
domain=${1:-http://YOURDOMAIN.com/bamboo}
user=userguy
password=secrets
agentId= | 81756161$2
#this tests most functionality, and can be customized as needed
#install and source resty
curl -L http://github.com/micha/resty/raw/master/resty > resty
. resty
#now do it!
resty "https://${domain}/builds" -k -H "Accept: application/json" -H "Content-Type: application/json" -u $username:$password
echo "creating new token"
muuid=`POST /rest/agent/latest/tokens '{"name":"doitall","read":"true","change":"true"}' | cut -d\" -f 4`
echo "returned UUID: | $uuid$muuid"
echo "show lists of tokens"
GET /rest/agent/latest/tokens >/dev/null
echo "dropping to anymous user and hitting homepage to get cookie"
resty " | https:///builds" -kL >/dev/null
GET / -j >/dev/null
echo "use token to get agent state @ /rest/agent/latest/${agentId}?uuid=${muuid}"
GET /rest/agent/latest/ | 81756161$agentId?uuid=${muuid} -Q >/dev/null
echo "disable agent"
POST /rest/agent/latest/ | 81756161$agentId/disable?uuid=${muuid} -Q >/dev/null
echo "enable agent"
POST /rest/agent/latest/ | 81756161$agentId/disable?uuid=${muuid} -Q >/dev/null
echo "All dones. You should see no warnings our errors above, only info ttext." |
|