This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
A module for testing the logic of states and highstates | |
:codeauthor: William Cannon <[email protected]> | |
:maturity: new | |
Saltcheck provides unittest like functionality requiring only the knowledge of | |
salt module execution and yaml. Saltcheck uses salt modules to return data, then | |
runs an assertion against that return. This allows for testing with all the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!py | |
import logging | |
import salt.runner | |
import salt.client | |
import salt.config | |
log = logging.getLogger(__name__) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
JSON='[{"arg": "docker", "client": "local","expr_form": "glob","fun": "state.sls","tgt": "SOMEHOST", "kwarg": ["test": "True"] }]' | |
RESPONSE=`curl -ik https://localhost:8000/login -H 'Content-Type: application/json' -d '[{"eauth":"pam","password":"PASSWORD","username":"USERNAME"}]' 2>/dev/null` | |
TOKEN=`echo $RESPONSE | grep -oP "[[:alnum:]]{40}" | uniq` | |
RESPONSE=`curl -k https://localhost:8000/ -H 'Accept: application/json' -H "X-Auth-Token: $TOKEN" -H 'Content-Type: application/json' -d "$JSON" 2>/dev/null` | |
echo $RESPONSE | tr '\n' ' ' | |
echo "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"info":[ | |
{ | |
"Function":"state.sls", | |
"jid":"20160219112937439194", | |
"Target":"stratos.kix", | |
"Target-type":"glob", | |
"User":"xian", | |
"StartTime":"2016, Feb 19 11:29:37.439194", | |
"Arguments":[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
JSON='[{"arg":["sleep 14; echo testing"],"client":"local","expr_form":"glob","fun":"cmd.run","tgt":"*"}]' | |
RESPONSE=`curl -ik https://localhost:8000/login -H 'Content-Type: application/json' -d '[{"eauth":"pam","password":"SOMEPASSWORD","username":"SOMEUSERNAME"}]' 2>/dev/null` | |
TOKEN=`echo $RESPONSE | grep -oP "[[:alnum:]]{40}" | uniq` | |
RESPONSE=`curl -ik https://localhost:8000/minions -H 'Accept: application/json' -H "X-Auth-Token: $TOKEN" -H 'Content-Type: application/json' -d "$JSON" 2>/dev/null` | |
JID=`echo $RESPONSE | grep -oP "[0-9]{20}" | uniq` | |
#echo GOT $JID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"return": [ | |
{ | |
"data": { | |
"stratos.kix": { | |
"cmd_|-failure_|-echo \"generated problem\" ; exit 5_|-run": { | |
"__run_num__": 1, | |
"changes": { | |
"pid": 16433, | |
"retcode": 5, | |
"stderr": "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<f:entry title="Target Type" field="targettype"> | |
<select name="targettype"> | |
<option value="glob">glob</option> | |
<option value="pcre">pcre</option> | |
<option value="list">list</option> | |
<option value="grain">grain</option> | |
<option value="pillar">pillar</option> | |
<option value="nodegroup">nodegroup</option> | |
<option value="range">range</option> | |
<option value="compound">compund</option> |