Skip to content

Commit 9067ca0

Browse files
committed
install testinfra and add first test
1 parent 9516219 commit 9067ca0

4 files changed

Lines changed: 11 additions & 1 deletion

File tree

roles/testinfra/tasks/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
3+
- name: Install testinfra at version 5.0.0
4+
pip: state=present name=testinfra version=5.0.0

scripts/update-vm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ verify_vm() {
6868
big_step "Verifying the VM..."
6969
cd $REPO_ROOT
7070
step "run integration tests"
71-
#testinfra -v --spec --color=yes spec/*.py
71+
py.test -v --color=yes spec/*.py
7272
}
7373

7474
big_step() {

site.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
- hosts: localhost
1111
roles:
1212
- { role: readme, tags: "readme" }
13+
- { role: testinfra, tags: "testinfra" }

spec/test_testinfra.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
def test_testinfra_is_installed_at_version_5_0_0_(host):
3+
cmd = host.run("pip3 show --disable-pip-version-check testinfra")
4+
assert cmd.rc is 0
5+
assert "Name: testinfra\nVersion: 5.0.0" in cmd.stdout

0 commit comments

Comments
 (0)