-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add molecule test for bootstrap-os (#5845)
- Loading branch information
Showing
8 changed files
with
94 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
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,16 @@ | ||
--- | ||
|
||
molecule_tests: | ||
tags: [vagrant] | ||
only: [/^pr-.*$/] | ||
except: ['triggers'] | ||
image: quay.io/miouge/kubespray-vagrant | ||
services: [] | ||
stage: deploy-part1 | ||
before_script: | ||
- tests/scripts/rebase.sh | ||
- apt-get update && apt-get install -y python3-pip | ||
- update-alternatives --install /usr/bin/python python /usr/bin/python3 10 | ||
- python -m pip install -r tests/requirements.txt | ||
script: | ||
- ./tests/scripts/molecule_run.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
scenario: | ||
name: default | ||
test_sequence: | ||
- lint | ||
- destroy | ||
- dependency | ||
- syntax | ||
- create | ||
- prepare | ||
- converge | ||
# - idempotence # skip | ||
- side_effect | ||
- verify | ||
- destroy | ||
dependency: | ||
name: galaxy | ||
lint: | ||
name: yamllint | ||
options: | ||
config-file: ../../.yamllint | ||
driver: | ||
name: vagrant | ||
provider: | ||
name: libvirt | ||
platforms: | ||
- name: ubuntu18 | ||
box: generic/ubuntu1804 | ||
cpus: 2 | ||
memory: 2048 | ||
provisioner: | ||
name: ansible | ||
lint: | ||
name: ansible-lint | ||
inventory: | ||
group_vars: | ||
all: | ||
user: | ||
name: foo | ||
comment: My test comment | ||
verifier: | ||
name: testinfra | ||
lint: | ||
name: flake8 |
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 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
gather_facts: no | ||
roles: | ||
- role: bootstrap-os |
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,11 @@ | ||
import os | ||
|
||
import testinfra.utils.ansible_runner | ||
|
||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( | ||
os.environ['MOLECULE_INVENTORY_FILE'] | ||
).get_hosts('all') | ||
|
||
|
||
def test_python(host): | ||
assert host.exists('python3') or host.exists('python') |
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 |
---|---|---|
|
@@ -6,3 +6,5 @@ dopy==0.3.7 | |
cryptography==2.8 | ||
ansible-lint==4.2.0 | ||
openshift==0.8.8 | ||
molecule==2.22 | ||
python-vagrant==0.5.15 |
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,12 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
export LC_ALL=C.UTF-8 | ||
export LANG=C.UTF-8 | ||
|
||
for d in $(find roles -name molecule -type d) | ||
do | ||
cd $(dirname $d) | ||
molecule test --all | ||
cd - | ||
done |