-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ondra Machacek <omachace@redhat.com>
- Loading branch information
1 parent
f977589
commit 3576a53
Showing
10 changed files
with
145 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: Ansible Test | ||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
merge_group: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
permissions: | ||
contents: read | ||
jobs: | ||
ansible_integration_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Update pip, git | ||
run: | | ||
set -euxo pipefail | ||
sudo apt-get update | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ansible_collections/redhat_cop/vmware_ops | ||
|
||
- name: Run | ||
run: | | ||
make integration | ||
working-directory: ansible_collections/redhat_cop/vmware_ops |
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,3 @@ | ||
integration: | ||
ansible-test integration --no-temp-workdir | ||
|
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,51 @@ | ||
[ | ||
{ | ||
"httpRequest": { | ||
"method": "POST", | ||
"path": "/rest/com/vmware/cis/session" | ||
}, | ||
"httpResponse": { | ||
"statusCode": 200, | ||
"body": {"value": "72300ca9ff16c5743fa0a6328c8570ce"} | ||
} | ||
}, | ||
{ | ||
"httpRequest": { | ||
"method": "PUT", | ||
"path": "/api/appliance/access/consolecli" | ||
}, | ||
"httpResponse": { | ||
"statusCode": 200, | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"body": "{}" | ||
} | ||
}, | ||
{ | ||
"httpRequest": { | ||
"method": "GET", | ||
"path": "/api/appliance/access/consolecli" | ||
}, | ||
"httpResponse": { | ||
"statusCode": 200, | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"body": "true" | ||
} | ||
}, | ||
{ | ||
"httpRequest": { | ||
"method" : "GET", | ||
"path" : "/api/appliance/networking/firewall/inbound" | ||
}, | ||
"httpResponse": { | ||
"statusCode": 200, | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"body": [{}] | ||
} | ||
} | ||
] |
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,2 @@ | ||
[testgroup] | ||
testhost ansible_connection="local" ansible_pipelining="yes" ansible_python_interpreter="/usr/bin/python3" |
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,5 @@ | ||
#!/usr/bin/env bash | ||
# shellcheck disable=SC2155,SC2086 | ||
|
||
BASE_DIR=$(dirname "${BASH_SOURCE[0]}") | ||
export ANSIBLE_ROLES_PATH=${BASE_DIR} |
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,26 @@ | ||
--- | ||
- name: Install dependencies | ||
ansible.builtin.pip: | ||
name: | ||
- requests | ||
- aiohttp | ||
|
||
- name: Run rest | ||
community.docker.docker_container: | ||
name: vmwarest | ||
image: mockserver/mockserver | ||
state: started | ||
recreate: yes | ||
exposed_ports: | ||
- 1080 | ||
ports: | ||
- 1080:1080 | ||
|
||
- name: Pause | ||
ansible.builtin.pause: | ||
seconds: 10 | ||
|
||
- name: Put data to mockserver | ||
ansible.builtin.command: | ||
cmd: "curl -v -X PUT --data @../../../expectations/mock.json http://localhost:1080/mockserver/expectation" | ||
|
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,15 @@ | ||
- hosts: localhost | ||
gather_facts: no | ||
collections: | ||
- community.general | ||
vars_files: | ||
- ../vars.yml | ||
|
||
tasks: | ||
- name: Vcsim | ||
ansible.builtin.import_role: | ||
name: prepare_rest | ||
Check failure on line 11 in tests/integration/targets/security/run.yml GitHub Actions / ansible-lintsyntax-check[specific]
|
||
|
||
- name: Import drs rule role | ||
ansible.builtin.import_role: | ||
name: security |
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,3 @@ | ||
#!/usr/bin/env bash | ||
source ../init.sh | ||
exec ansible-playbook run.yml |
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,4 @@ | ||
--- | ||
- name: Run | ||
ansible.builtin.import_role: | ||
name: redhat_cop.vmware_ops.security |
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,6 @@ | ||
security_hostname: "127.0.0.1:1080" | ||
security_username: "user" | ||
security_password: "pass" | ||
security_validate_certs: false | ||
|
||
security_consolecli_enabled: true |