Use output_dir instead of outputdir for tests.

This commit is contained in:
Matt Clay 2016-11-21 16:23:40 -08:00
parent d90638ad40
commit 324702c38f
2 changed files with 25 additions and 25 deletions

View file

@ -67,7 +67,7 @@ environment:
(cd targets/environment && ./runme.sh $(TEST_FLAGS)) (cd targets/environment && ./runme.sh $(TEST_FLAGS))
non_destructive: setup non_destructive: setup
ANSIBLE_ROLES_PATH=$(shell pwd)/targets ansible-playbook non_destructive.yml -i $(INVENTORY) -e outputdir=$(TEST_DIR) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS) ANSIBLE_ROLES_PATH=$(shell pwd)/targets ansible-playbook non_destructive.yml -i $(INVENTORY) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS)
# Tests which can be run when running as root and a local SSH daemon is available. # Tests which can be run when running as root and a local SSH daemon is available.
test_root_ssh: test_connection_local test_connection_chroot test_connection_ssh test_connection_paramiko_ssh test_delegate_to test_root_ssh: test_connection_local test_connection_chroot test_connection_ssh test_connection_paramiko_ssh test_delegate_to
@ -138,7 +138,7 @@ test_connection_winrm:
(cd targets/connection_winrm && ./runme.sh $(TEST_FLAGS)) (cd targets/connection_winrm && ./runme.sh $(TEST_FLAGS))
destructive: setup destructive: setup
ANSIBLE_ROLES_PATH=$(shell pwd)/targets ansible-playbook destructive.yml -i $(INVENTORY) -e outputdir=$(TEST_DIR) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS) ANSIBLE_ROLES_PATH=$(shell pwd)/targets ansible-playbook destructive.yml -i $(INVENTORY) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS)
check_mode: check_mode:
(cd targets/check_mode && ./runme.sh $(TEST_FLAGS)) (cd targets/check_mode && ./runme.sh $(TEST_FLAGS))
@ -174,13 +174,13 @@ ci_win3: test_win_group3 test_connection_winrm
test_winrm: test_win_group1 test_win_group2 test_win_group3 test_winrm: test_win_group1 test_win_group2 test_win_group3
test_win_group1: test_win_group1:
ANSIBLE_ROLES_PATH=$(shell pwd)/targets ansible-playbook test_win_group1.yml -i inventory.winrm -e outputdir=$(TEST_DIR) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS) ANSIBLE_ROLES_PATH=$(shell pwd)/targets ansible-playbook test_win_group1.yml -i inventory.winrm -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS)
test_win_group2: test_win_group2:
ANSIBLE_ROLES_PATH=$(shell pwd)/targets ansible-playbook test_win_group2.yml -i inventory.winrm -e outputdir=$(TEST_DIR) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS) ANSIBLE_ROLES_PATH=$(shell pwd)/targets ansible-playbook test_win_group2.yml -i inventory.winrm -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS)
test_win_group3: test_win_group3:
ANSIBLE_ROLES_PATH=$(shell pwd)/targets ansible-playbook test_win_group3.yml -i inventory.winrm -e outputdir=$(TEST_DIR) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS) ANSIBLE_ROLES_PATH=$(shell pwd)/targets ansible-playbook test_win_group3.yml -i inventory.winrm -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS)
test_tags: test_tags:
(cd targets/tags && ./runme.sh $(TEST_FLAGS)) (cd targets/tags && ./runme.sh $(TEST_FLAGS))
@ -272,7 +272,7 @@ test_galaxy_spec: setup
mytmpdir=$(MYTMPDIR) ; \ mytmpdir=$(MYTMPDIR) ; \
ansible-galaxy install -r galaxy_rolesfile -p $$mytmpdir/roles -vvvv ; \ ansible-galaxy install -r galaxy_rolesfile -p $$mytmpdir/roles -vvvv ; \
cp galaxy_playbook.yml $$mytmpdir ; \ cp galaxy_playbook.yml $$mytmpdir ; \
ansible-playbook -i $(INVENTORY) $$mytmpdir/galaxy_playbook.yml -e outputdir=$(TEST_DIR) -v $(TEST_FLAGS) ; \ ansible-playbook -i $(INVENTORY) $$mytmpdir/galaxy_playbook.yml -e @$(VARS_FILE) -v $(TEST_FLAGS) ; \
RC=$$? ; \ RC=$$? ; \
rm -rf $$mytmpdir ; \ rm -rf $$mytmpdir ; \
exit $$RC exit $$RC
@ -281,7 +281,7 @@ test_galaxy_yaml: setup
mytmpdir=$(MYTMPDIR) ; \ mytmpdir=$(MYTMPDIR) ; \
ansible-galaxy install -r galaxy_roles.yml -p $$mytmpdir/roles -vvvv; \ ansible-galaxy install -r galaxy_roles.yml -p $$mytmpdir/roles -vvvv; \
cp galaxy_playbook.yml $$mytmpdir ; \ cp galaxy_playbook.yml $$mytmpdir ; \
ansible-playbook -i $(INVENTORY) $$mytmpdir/galaxy_playbook.yml -e outputdir=$(TEST_DIR) -v $(TEST_FLAGS) ; \ ansible-playbook -i $(INVENTORY) $$mytmpdir/galaxy_playbook.yml -e @$(VARS_FILE) -v $(TEST_FLAGS) ; \
RC=$$? ; \ RC=$$? ; \
rm -rf $$mytmpdir ; \ rm -rf $$mytmpdir ; \
exit $$RC exit $$RC

View file

@ -18,24 +18,24 @@
- name: Create the mount point - name: Create the mount point
file: file:
state: "directory" state: "directory"
path: "{{ outputdir }}/mount_dest" path: "{{ output_dir }}/mount_dest"
- name: Create a directory to bind mount - name: Create a directory to bind mount
file: file:
state: "directory" state: "directory"
path: "{{ outputdir }}/mount_source" path: "{{ output_dir }}/mount_source"
- name: Put something in the directory so we see that it worked - name: Put something in the directory so we see that it worked
copy: copy:
content: "Testing\n" content: "Testing\n"
dest: "{{ outputdir }}/mount_source/test_file" dest: "{{ output_dir }}/mount_source/test_file"
register: orig_info register: orig_info
# The opts type of bind mount only works on Linux # The opts type of bind mount only works on Linux
- name: Bind mount a filesystem (Linux) - name: Bind mount a filesystem (Linux)
mount: mount:
src: "{{ outputdir }}/mount_source" src: "{{ output_dir }}/mount_source"
name: "{{ outputdir }}/mount_dest" name: "{{ output_dir }}/mount_dest"
state: "mounted" state: "mounted"
fstype: "None" fstype: "None"
opts: "bind" opts: "bind"
@ -45,8 +45,8 @@
# Nullfs is freebsd only # Nullfs is freebsd only
- name: Bind mount a filesystem (FreeBSD) - name: Bind mount a filesystem (FreeBSD)
mount: mount:
src: "{{ outputdir }}/mount_source" src: "{{ output_dir }}/mount_source"
name: "{{ outputdir }}/mount_dest" name: "{{ output_dir }}/mount_dest"
state: "mounted" state: "mounted"
fstype: "nullfs" fstype: "nullfs"
when: ansible_system == 'FreeBSD' when: ansible_system == 'FreeBSD'
@ -54,7 +54,7 @@
- name: get checksum for bind mounted file - name: get checksum for bind mounted file
stat: stat:
path: "{{ outputdir }}/mount_dest/test_file" path: "{{ output_dir }}/mount_dest/test_file"
when: ansible_system in ('FreeBSD', 'Linux') when: ansible_system in ('FreeBSD', 'Linux')
register: dest_stat register: dest_stat
@ -69,8 +69,8 @@
# The opts type of bind mount only works on Linux # The opts type of bind mount only works on Linux
- name: Bind mount a filesystem (Linux) - name: Bind mount a filesystem (Linux)
mount: mount:
src: "{{ outputdir }}/mount_source" src: "{{ output_dir }}/mount_source"
name: "{{ outputdir }}/mount_dest" name: "{{ output_dir }}/mount_dest"
state: "mounted" state: "mounted"
fstype: "None" fstype: "None"
opts: "bind" opts: "bind"
@ -80,8 +80,8 @@
# Nullfs is freebsd only # Nullfs is freebsd only
- name: Bind mount a filesystem (FreeBSD) - name: Bind mount a filesystem (FreeBSD)
mount: mount:
src: "{{ outputdir }}/mount_source" src: "{{ output_dir }}/mount_source"
name: "{{ outputdir }}/mount_dest" name: "{{ output_dir }}/mount_dest"
state: "mounted" state: "mounted"
fstype: "nullfs" fstype: "nullfs"
when: ansible_system == 'FreeBSD' when: ansible_system == 'FreeBSD'
@ -96,8 +96,8 @@
# The opts type of bind mount only works on Linux # The opts type of bind mount only works on Linux
- name: Remount filesystem with different opts (Linux) - name: Remount filesystem with different opts (Linux)
mount: mount:
src: "{{ outputdir }}/mount_source" src: "{{ output_dir }}/mount_source"
name: "{{ outputdir }}/mount_dest" name: "{{ output_dir }}/mount_dest"
state: "mounted" state: "mounted"
fstype: "None" fstype: "None"
opts: "bind,ro" opts: "bind,ro"
@ -107,8 +107,8 @@
# Nullfs is freebsd only # Nullfs is freebsd only
- name: Remount filesystem with different opts (FreeBSD) - name: Remount filesystem with different opts (FreeBSD)
mount: mount:
src: "{{ outputdir }}/mount_source" src: "{{ output_dir }}/mount_source"
name: "{{ outputdir }}/mount_dest" name: "{{ output_dir }}/mount_dest"
state: "mounted" state: "mounted"
fstype: "nullfs" fstype: "nullfs"
opts: "ro" opts: "ro"
@ -131,14 +131,14 @@
- name: Unmount the bind mount - name: Unmount the bind mount
mount: mount:
name: "{{ outputdir }}/mount_dest" name: "{{ output_dir }}/mount_dest"
state: "absent" state: "absent"
when: ansible_system in ('Linux', 'FreeBSD') when: ansible_system in ('Linux', 'FreeBSD')
register: unmount_result register: unmount_result
- name: Make sure the file no longer exists in dest - name: Make sure the file no longer exists in dest
stat: stat:
path: "{{ outputdir }}/mount_dest/test_file" path: "{{ output_dir }}/mount_dest/test_file"
when: ansible_system in ('FreeBSD', 'Linux') when: ansible_system in ('FreeBSD', 'Linux')
register: dest_stat register: dest_stat