Fix integration test temp dir usage. (#60555)

* Fix xfs_quota integration test temp dir usage.
* Fix lvg integration test temp dir usage.
* Fix filesystem integration test temp dir usage.
* Fix connection_windows_ssh test temp dir usage.
pull/60558/head
Matt Clay 5 years ago committed by GitHub
parent ba1b4565d3
commit b07f96c31d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,7 +7,7 @@ set -eux
### cmd tests - no DefaultShell set ###
ansible -i ../../inventory.winrm localhost \
-m template \
-a "src=test_connection.inventory.j2 dest=~/ansible_testing/test_connection.inventory" \
-a "src=test_connection.inventory.j2 dest=${OUTPUT_DIR}/test_connection.inventory" \
-e "test_shell_type=cmd" \
"$@"
@ -18,7 +18,7 @@ ansible -i ../../inventory.winrm windows \
"$@"
# Need to flush the connection to ensure we get a new shell for the next tests
ansible -i ~/ansible_testing/test_connection.inventory windows-ssh \
ansible -i "${OUTPUT_DIR}/test_connection.inventory" windows-ssh \
-m meta -a "reset_connection" \
"$@"
@ -27,14 +27,14 @@ ansible -i ~/ansible_testing/test_connection.inventory windows-ssh \
# scp
ANSIBLE_SCP_IF_SSH=true ./windows.sh "$@"
# other tests not part of the generic connection test framework
ansible-playbook -i ~/ansible_testing/test_connection.inventory tests.yml \
ansible-playbook -i "${OUTPUT_DIR}/test_connection.inventory" tests.yml \
"$@"
### powershell tests - explicit DefaultShell set ###
# we do this last as the default shell on our CI instances is set to PowerShell
ansible -i ../../inventory.winrm localhost \
-m template \
-a "src=test_connection.inventory.j2 dest=~/ansible_testing/test_connection.inventory" \
-a "src=test_connection.inventory.j2 dest=${OUTPUT_DIR}/test_connection.inventory" \
-e "test_shell_type=powershell" \
"$@"
@ -44,11 +44,11 @@ ansible -i ../../inventory.winrm windows \
-a "path=HKLM:\\\\SOFTWARE\\\\OpenSSH name=DefaultShell data=C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe" \
"$@"
ansible -i ~/ansible_testing/test_connection.inventory windows-ssh \
ansible -i "${OUTPUT_DIR}/test_connection.inventory" windows-ssh \
-m meta -a "reset_connection" \
"$@"
./windows.sh "$@"
ANSIBLE_SCP_IF_SSH=true ./windows.sh "$@"
ansible-playbook -i ~/ansible_testing/test_connection.inventory tests.yml \
ansible-playbook -i "${OUTPUT_DIR}/test_connection.inventory" tests.yml \
"$@"

@ -10,7 +10,7 @@ cd ../connection
# container has been updated.
# https://unix.stackexchange.com/questions/499958/why-does-scps-strict-filename-checking-reject-quoted-last-component-but-not-oth
# https://github.com/openssh/openssh-portable/commit/391ffc4b9d31fa1f4ad566499fef9176ff8a07dc
INVENTORY=~/ansible_testing/test_connection.inventory ./test.sh \
INVENTORY="${OUTPUT_DIR}/test_connection.inventory" ./test.sh \
-e target_hosts=windows-ssh \
-e action_prefix=win_ \
-e local_tmp=/tmp/ansible-local \
@ -20,6 +20,6 @@ INVENTORY=~/ansible_testing/test_connection.inventory ./test.sh \
cd ../connection_windows_ssh
ansible-playbook -i ~/ansible_testing/test_connection.inventory tests_fetch.yml \
ansible-playbook -i "${OUTPUT_DIR}/test_connection.inventory" tests_fetch.yml \
-e ansible_scp_extra_args=-T \
"$@"

@ -0,0 +1,2 @@
dependencies:
- setup_remote_tmp_dir

@ -15,7 +15,7 @@
- include_tasks: create_device.yml
vars:
image_file: '{{ ansible_user_dir }}/ansible_testing/img'
image_file: '{{ remote_tmp_dir }}/img'
fstype: '{{ item.0.key }}'
fssize: '{{ item.0.value.fssize }}'
grow: '{{ item.0.value.grow }}'

@ -0,0 +1,2 @@
dependencies:
- setup_remote_tmp_dir

@ -1,9 +1,9 @@
- name: "Create files to use as a disk devices"
command: "dd if=/dev/zero of={{ ansible_user_dir }}/ansible_testing/img{{ item }} bs=1M count=10"
command: "dd if=/dev/zero of={{ remote_tmp_dir }}/img{{ item }} bs=1M count=10"
with_sequence: 'count=2'
- name: "Create loop device for file"
command: "losetup --show -f {{ ansible_user_dir }}/ansible_testing/img{{ item }}"
command: "losetup --show -f {{ remote_tmp_dir }}/img{{ item }}"
with_sequence: 'count=2'
register: loop_devices

@ -12,6 +12,6 @@
- name: Remove device files
file:
path: "{{ ansible_user_dir }}/ansible_testing/img{{ item }}"
path: "{{ remote_tmp_dir }}/img{{ item }}"
state: absent
with_sequence: 'count={{ loop_devices.results|length }}'

@ -0,0 +1,2 @@
dependencies:
- setup_remote_tmp_dir

@ -1,19 +1,19 @@
---
- name: 'Create disk image'
command: >
dd if=/dev/zero of={{ ansible_user_dir }}/ansible_testing/img-gquota bs=1M count=20
dd if=/dev/zero of={{ remote_tmp_dir }}/img-gquota bs=1M count=20
- name: 'Create XFS filesystem'
filesystem:
dev: '{{ ansible_user_dir }}/ansible_testing/img-gquota'
dev: '{{ remote_tmp_dir }}/img-gquota'
fstype: xfs
- block:
- name: 'Mount filesystem'
mount:
fstab: '{{ ansible_user_dir }}/ansible_testing/fstab'
src: '{{ ansible_user_dir }}/ansible_testing/img-gquota'
path: '{{ ansible_user_dir }}/ansible_testing/gquota'
fstab: '{{ remote_tmp_dir }}/fstab'
src: '{{ remote_tmp_dir }}/img-gquota'
path: '{{ remote_tmp_dir }}/gquota'
fstype: xfs
opts: gquota
state: mounted
@ -25,7 +25,7 @@
bhard: '{{ gquota_default_bhard }}'
isoft: '{{ gquota_default_isoft }}'
ihard: '{{ gquota_default_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/gquota'
mountpoint: '{{ remote_tmp_dir }}/gquota'
rtbsoft: '{{ gquota_default_rtbsoft }}'
rtbhard: '{{ gquota_default_rtbhard }}'
type: group
@ -49,7 +49,7 @@
bhard: '{{ gquota_group_bhard }}'
isoft: '{{ gquota_group_isoft }}'
ihard: '{{ gquota_group_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/gquota'
mountpoint: '{{ remote_tmp_dir }}/gquota'
name: xfsquotauser
rtbsoft: '{{ gquota_group_rtbsoft }}'
rtbhard: '{{ gquota_group_rtbhard }}'
@ -74,7 +74,7 @@
bhard: '{{ gquota_default_bhard }}'
isoft: '{{ gquota_default_isoft }}'
ihard: '{{ gquota_default_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/gquota'
mountpoint: '{{ remote_tmp_dir }}/gquota'
rtbsoft: '{{ gquota_default_rtbsoft }}'
rtbhard: '{{ gquota_default_rtbhard }}'
type: group
@ -92,7 +92,7 @@
bhard: '{{ gquota_group_bhard }}'
isoft: '{{ gquota_group_isoft }}'
ihard: '{{ gquota_group_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/gquota'
mountpoint: '{{ remote_tmp_dir }}/gquota'
name: xfsquotauser
rtbsoft: '{{ gquota_group_rtbsoft }}'
rtbhard: '{{ gquota_group_rtbhard }}'
@ -107,7 +107,7 @@
- name: 'Reset default group limits'
xfs_quota:
mountpoint: '{{ ansible_user_dir }}/ansible_testing/gquota'
mountpoint: '{{ remote_tmp_dir }}/gquota'
state: absent
type: group
become: True
@ -126,7 +126,7 @@
- name: 'Reset group limits for xfsquotauser'
xfs_quota:
mountpoint: '{{ ansible_user_dir }}/ansible_testing/gquota'
mountpoint: '{{ remote_tmp_dir }}/gquota'
name: xfsquotauser
state: absent
type: group
@ -147,12 +147,12 @@
always:
- name: 'Unmount filesystem'
mount:
fstab: '{{ ansible_user_dir }}/ansible_testing/fstab'
path: '{{ ansible_user_dir }}/ansible_testing/gquota'
fstab: '{{ remote_tmp_dir }}/fstab'
path: '{{ remote_tmp_dir }}/gquota'
state: unmounted
become: True
- name: Remove disk image
file:
path: '{{ ansible_user_dir }}/ansible_testing/img-gquota'
path: '{{ remote_tmp_dir }}/img-gquota'
state: absent

@ -1,11 +1,11 @@
---
- name: 'Create disk image'
command: >
dd if=/dev/zero of={{ ansible_user_dir }}/ansible_testing/img-pquota bs=1M count=20
dd if=/dev/zero of={{ remote_tmp_dir }}/img-pquota bs=1M count=20
- name: 'Create XFS filesystem'
filesystem:
dev: '{{ ansible_user_dir }}/ansible_testing/img-pquota'
dev: '{{ remote_tmp_dir }}/img-pquota'
fstype: xfs
- name: Create xfs related files
@ -27,16 +27,16 @@
- name: 'Add test xfs quota project path'
lineinfile:
path: /etc/projects
line: '99999:{{ ansible_user_dir }}/ansible_testing/pquota/test'
line: '99999:{{ remote_tmp_dir }}/pquota/test'
state: present
become: True
- block:
- name: 'Mount filesystem'
mount:
fstab: '{{ ansible_user_dir }}/ansible_testing/fstab'
src: '{{ ansible_user_dir }}/ansible_testing/img-pquota'
path: '{{ ansible_user_dir }}/ansible_testing/pquota'
fstab: '{{ remote_tmp_dir }}/fstab'
src: '{{ remote_tmp_dir }}/img-pquota'
path: '{{ remote_tmp_dir }}/pquota'
fstype: xfs
opts: pquota
state: mounted
@ -44,7 +44,7 @@
- name: 'Create test directory'
file:
path: '{{ ansible_user_dir }}/ansible_testing/pquota/test'
path: '{{ remote_tmp_dir }}/pquota/test'
state: directory
become: True
@ -55,7 +55,7 @@
bhard: '{{ pquota_default_bhard }}'
isoft: '{{ pquota_default_isoft }}'
ihard: '{{ pquota_default_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/pquota'
mountpoint: '{{ remote_tmp_dir }}/pquota'
rtbsoft: '{{ pquota_default_rtbsoft }}'
rtbhard: '{{ pquota_default_rtbhard }}'
type: project
@ -79,7 +79,7 @@
bhard: '{{ pquota_project_bhard }}'
isoft: '{{ pquota_project_isoft }}'
ihard: '{{ pquota_project_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/pquota'
mountpoint: '{{ remote_tmp_dir }}/pquota'
name: xft_quotaval
rtbsoft: '{{ pquota_project_rtbsoft }}'
rtbhard: '{{ pquota_project_rtbhard }}'
@ -104,7 +104,7 @@
bhard: '{{ pquota_default_bhard }}'
isoft: '{{ pquota_default_isoft }}'
ihard: '{{ pquota_default_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/pquota'
mountpoint: '{{ remote_tmp_dir }}/pquota'
rtbsoft: '{{ pquota_default_rtbsoft }}'
rtbhard: '{{ pquota_default_rtbhard }}'
type: project
@ -122,7 +122,7 @@
bhard: '{{ pquota_project_bhard }}'
isoft: '{{ pquota_project_isoft }}'
ihard: '{{ pquota_project_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/pquota'
mountpoint: '{{ remote_tmp_dir }}/pquota'
name: xft_quotaval
rtbsoft: '{{ pquota_project_rtbsoft }}'
rtbhard: '{{ pquota_project_rtbhard }}'
@ -137,7 +137,7 @@
- name: 'Reset default project limits'
xfs_quota:
mountpoint: '{{ ansible_user_dir }}/ansible_testing/pquota'
mountpoint: '{{ remote_tmp_dir }}/pquota'
state: absent
type: project
become: True
@ -156,7 +156,7 @@
- name: 'Reset project limits for xft_quotaval'
xfs_quota:
mountpoint: '{{ ansible_user_dir }}/ansible_testing/pquota'
mountpoint: '{{ remote_tmp_dir }}/pquota'
name: xft_quotaval
state: absent
type: project
@ -177,14 +177,14 @@
always:
- name: 'Unmount filesystem'
mount:
fstab: '{{ ansible_user_dir }}/ansible_testing/fstab'
path: '{{ ansible_user_dir }}/ansible_testing/pquota'
fstab: '{{ remote_tmp_dir }}/fstab'
path: '{{ remote_tmp_dir }}/pquota'
state: unmounted
become: True
- name: Remove disk image
file:
path: '{{ ansible_user_dir }}/ansible_testing/img-pquota'
path: '{{ remote_tmp_dir }}/img-pquota'
state: absent
- name: Remove xfs quota project id

@ -1,19 +1,19 @@
---
- name: 'Create disk image'
command: >
dd if=/dev/zero of={{ ansible_user_dir }}/ansible_testing/img-uquota bs=1M count=20
dd if=/dev/zero of={{ remote_tmp_dir }}/img-uquota bs=1M count=20
- name: 'Create XFS filesystem'
filesystem:
dev: '{{ ansible_user_dir }}/ansible_testing/img-uquota'
dev: '{{ remote_tmp_dir }}/img-uquota'
fstype: xfs
- block:
- name: 'Mount filesystem'
mount:
fstab: '{{ ansible_user_dir }}/ansible_testing/fstab'
src: '{{ ansible_user_dir }}/ansible_testing/img-uquota'
path: '{{ ansible_user_dir }}/ansible_testing/uquota'
fstab: '{{ remote_tmp_dir }}/fstab'
src: '{{ remote_tmp_dir }}/img-uquota'
path: '{{ remote_tmp_dir }}/uquota'
fstype: xfs
opts: uquota
state: mounted
@ -25,7 +25,7 @@
bhard: '{{ uquota_default_bhard }}'
isoft: '{{ uquota_default_isoft }}'
ihard: '{{ uquota_default_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/uquota'
mountpoint: '{{ remote_tmp_dir }}/uquota'
rtbsoft: '{{ uquota_default_rtbsoft }}'
rtbhard: '{{ uquota_default_rtbhard }}'
type: user
@ -49,7 +49,7 @@
bhard: '{{ uquota_user_bhard }}'
isoft: '{{ uquota_user_isoft }}'
ihard: '{{ uquota_user_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/uquota'
mountpoint: '{{ remote_tmp_dir }}/uquota'
name: xfsquotauser
rtbsoft: '{{ uquota_user_rtbsoft }}'
rtbhard: '{{ uquota_user_rtbhard }}'
@ -74,7 +74,7 @@
bhard: '{{ uquota_default_bhard }}'
isoft: '{{ uquota_default_isoft }}'
ihard: '{{ uquota_default_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/uquota'
mountpoint: '{{ remote_tmp_dir }}/uquota'
rtbsoft: '{{ uquota_default_rtbsoft }}'
rtbhard: '{{ uquota_default_rtbhard }}'
type: user
@ -92,7 +92,7 @@
bhard: '{{ uquota_user_bhard }}'
isoft: '{{ uquota_user_isoft }}'
ihard: '{{ uquota_user_ihard }}'
mountpoint: '{{ ansible_user_dir }}/ansible_testing/uquota'
mountpoint: '{{ remote_tmp_dir }}/uquota'
name: xfsquotauser
rtbsoft: '{{ uquota_user_rtbsoft }}'
rtbhard: '{{ uquota_user_rtbhard }}'
@ -107,7 +107,7 @@
- name: 'Reset default user limits'
xfs_quota:
mountpoint: '{{ ansible_user_dir }}/ansible_testing/uquota'
mountpoint: '{{ remote_tmp_dir }}/uquota'
state: absent
type: user
become: True
@ -126,7 +126,7 @@
- name: 'Reset user limits for xfsquotauser'
xfs_quota:
mountpoint: '{{ ansible_user_dir }}/ansible_testing/uquota'
mountpoint: '{{ remote_tmp_dir }}/uquota'
name: xfsquotauser
state: absent
type: user
@ -147,12 +147,12 @@
always:
- name: 'Unmount filesystem'
mount:
fstab: '{{ ansible_user_dir }}/ansible_testing/fstab'
path: '{{ ansible_user_dir }}/ansible_testing/uquota'
fstab: '{{ remote_tmp_dir }}/fstab'
path: '{{ remote_tmp_dir }}/uquota'
state: unmounted
become: True
- name: Remove disk image
file:
path: '{{ ansible_user_dir }}/ansible_testing/img-uquota'
path: '{{ remote_tmp_dir }}/img-uquota'
state: absent

Loading…
Cancel
Save