-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #355 from rundeck-plugins/add-plugin-group
add plugin group
- Loading branch information
Showing
20 changed files
with
700 additions
and
226 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
83 changes: 83 additions & 0 deletions
83
functional-test/src/test/groovy/functional/PluginGroupIntegrationSpec.groovy
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package functional | ||
|
||
import functional.base.BaseTestConfiguration | ||
import functional.util.TestUtil | ||
import org.rundeck.client.api.model.JobRun | ||
import org.testcontainers.spock.Testcontainers | ||
|
||
|
||
@Testcontainers | ||
class PluginGroupIntegrationSpec extends BaseTestConfiguration { | ||
|
||
static String PROJ_NAME = 'ansible-plugin-group-test' | ||
|
||
def setupSpec() { | ||
startCompose() | ||
configureRundeck(PROJ_NAME) | ||
} | ||
|
||
def "test simple inline playbook"(){ | ||
when: | ||
|
||
def jobId = "fa0e401b-b5a8-436a-b13b-0e8092858021" | ||
|
||
JobRun request = new JobRun() | ||
request.loglevel = 'DEBUG' | ||
|
||
def result = client.apiCall {api-> api.runJob(jobId, request)} | ||
def executionId = result.id | ||
|
||
def executionState = waitForJob(executionId) | ||
|
||
def logs = getLogs(executionId) | ||
Map<String, Integer> ansibleNodeExecutionStatus = TestUtil.getAnsibleNodeResult(logs) | ||
|
||
then: | ||
executionState!=null | ||
executionState.getExecutionState()=="SUCCEEDED" | ||
ansibleNodeExecutionStatus.get("ok")!=0 | ||
ansibleNodeExecutionStatus.get("unreachable")==0 | ||
ansibleNodeExecutionStatus.get("failed")==0 | ||
ansibleNodeExecutionStatus.get("skipped")==0 | ||
ansibleNodeExecutionStatus.get("ignored")==0 | ||
|
||
logs.findAll {it.log.contains("plugin group set getAnsibleConfigFilePath: /home/rundeck/ansible")}.size() == 1 | ||
logs.findAll {it.log.contains("ANSIBLE_CONFIG: /home/rundeck/ansible")}.size() == 1 | ||
|
||
} | ||
|
||
def "test simple inline playbook with env vars"(){ | ||
when: | ||
|
||
def jobId = "572367d2-e41a-4fdb-b6fc-effa32185b61" | ||
|
||
JobRun request = new JobRun() | ||
request.loglevel = 'DEBUG' | ||
|
||
def result = client.apiCall {api-> api.runJob(jobId, request)} | ||
def executionId = result.id | ||
|
||
def executionState = waitForJob(executionId) | ||
|
||
def logs = getLogs(executionId) | ||
Map<String, Integer> ansibleNodeExecutionStatus = TestUtil.getAnsibleNodeResult(logs) | ||
|
||
then: | ||
executionState!=null | ||
executionState.getExecutionState()=="SUCCEEDED" | ||
ansibleNodeExecutionStatus.get("ok")!=0 | ||
ansibleNodeExecutionStatus.get("unreachable")==0 | ||
ansibleNodeExecutionStatus.get("failed")==0 | ||
ansibleNodeExecutionStatus.get("skipped")==0 | ||
ansibleNodeExecutionStatus.get("ignored")==0 | ||
logs.findAll {it.log.contains("plugin group set getAnsibleConfigFilePath: /home/rundeck/ansible")}.size() == 1 | ||
logs.findAll {it.log.contains("plugin group set getEncryptExtraVars: true")}.size() == 1 | ||
logs.findAll {it.log.contains("ANSIBLE_CONFIG: /home/rundeck/ansible")}.size() == 1 | ||
logs.findAll {it.log.contains("encryptVariable password")}.size() == 1 | ||
logs.findAll {it.log.contains("encryptVariable username")}.size() == 1 | ||
logs.findAll {it.log.contains("\"msg\": \"rundeck\"")}.size() == 1 | ||
logs.findAll {it.log.contains("\"msg\": \"demo\"")}.size() == 1 | ||
|
||
} | ||
|
||
} |
144 changes: 0 additions & 144 deletions
144
functional-test/src/test/groovy/functional/RundeckCompose.groovy
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.