Skip to content

Commit 9815b0e

Browse files
author
choglundsp
authored
Merge pull request #2 from singleplatform-eng/update_tests
Update tests
2 parents fdcdacf + 78e5008 commit 9815b0e

File tree

8 files changed

+39
-121
lines changed

8 files changed

+39
-121
lines changed

.travis.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1+
---
2+
sudo: required
13
language: python
2-
python:
3-
- "2.7"
4+
python: "2.7"
5+
46
install:
5-
- "pip install ansible"
7+
- pip install ansible
8+
9+
# Add ansible.cfg to pick up roles path.
10+
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
11+
612
script:
7-
- cd tests
8-
- ansible-playbook --connection=local --limit=localhost --inventory-file=hosts all.yml
13+
# Syntax Check
14+
- ansible-playbook -i localhost, tests/test.yml --syntax-check
15+
16+
# Run test.yml
17+
- ansible-playbook -i localhost, --connection=local --sudo tests/test.yml
918

19+
# Run the role/playbook again, checking to make sure it's idempotent.
20+
- >
21+
ansible-playbook -i localhost, --connection=local --sudo tests/test.yml
22+
| grep -q 'changed=0.*failed=0'
23+
&& (echo 'Idempotence test: pass' && exit 0)
24+
|| (echo 'Idempotence test: fail' && exit 1)

tests/add_user.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

tests/all.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/cleanup.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/hosts

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/roles/users

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/ssh_keys_optional.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

tests/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
3+
- hosts: localhost
4+
remote_user: root
5+
vars:
6+
users:
7+
- name: Ansible Test User
8+
username: ansibletestuser
9+
uid: 2222
10+
groups: [users, bin]
11+
shell: /bin/sh
12+
profile: |
13+
alias ll='ls -lah'
14+
alias cp='cp -iv'
15+
ssh_key:
16+
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVpUJQCOaPg3p5xro9e+1fkGRWNOGrrExiKMqTE91Fwu349bxfMnMzRS0PAERouR9EEL+Ee4Yzhav/uNc35eCtXzACtluXnAncMrQj6pM3IqASynhvXTygHljmcMbBSDQtLrTZeW+YzIcOgk5UM1yBi26WoUYva2aCr9IRvKdYreAK08OiMdZedpOye0ZdvIYJGcyITwc6YMmrAhP7jZlrk/mDEkf2a4eBp+475o7MJtaC9npqYkToM8vqvx5AGEKqXt7/f1/paOY7KsR+VGPQy6k2RkXjWBsXPesZ3d3XLZHE60wAk0EsuJO8A25+uWSB6ILQeRSYYmGea/WIf6kd [email protected]"
17+
18+
roles:
19+
- ansible-users

0 commit comments

Comments
 (0)