Skip to content

Commit

Permalink
Fix subversion integration test (ansible#82029)
Browse files Browse the repository at this point in the history
- Remove dependency on the htpasswd module (and thus passlib)
- Fix setup/teardown of the httpd process
- Fix cleanup of temporary directories
  • Loading branch information
mattclay committed Oct 19, 2023
1 parent 598a930 commit 09d9434
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 284 deletions.
1 change: 0 additions & 1 deletion test/integration/targets/subversion/aliases
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
setup/always/setup_passlib
shippable/posix/group2
skip/macos
destructive
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
---
- name: stop apache after tests
shell: "kill -9 $(cat '{{ subversion_server_dir }}/apache.pid')"
- name: stop apache after tests - non Red Hat
shell: apachectl -k stop -f {{ subversion_server_dir }}/subversion.conf
when: ansible_os_family not in ['RedHat']

- name: stop apache after tests - Red Hat
shell: "kill $(cat '{{ subversion_server_dir }}/apache.pid')"
when: ansible_os_family in ['RedHat']

- name: remove tmp subversion server dir
file:
path: '{{ subversion_server_dir }}'
state: absent

- name: remove tmp subversion checkout dir
file:
path: '{{ subversion_test_dir }}'
state: absent
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@
creates: '{{ subversion_server_dir }}/{{ subversion_repo_name }}'

- name: add test user to htpasswd for Subversion site
htpasswd:
path: '{{ subversion_server_dir }}/svn-auth-users'
name: '{{ subversion_username }}'
password: '{{ subversion_password }}'
state: present
command: htpasswd -bc {{ subversion_server_dir + '/svn-auth-users' | quote }} {{ subversion_username | quote }} {{ subversion_password | quote }}

- name: apply ownership for all SVN directories
file:
Expand All @@ -62,11 +58,11 @@
command: apachectl -k start -f {{ subversion_server_dir }}/subversion.conf
async: 3600 # We kill apache manually in the clean up phase
poll: 0
when: ansible_os_family not in ['RedHat', 'Alpine']
when: ansible_os_family not in ['RedHat']

# On Red Hat based OS', we can't use apachectl to start up own instance, just use the raw httpd
- name: start test Apache SVN site - Red Hat
command: httpd -k start -f {{ subversion_server_dir }}/subversion.conf
async: 3600 # We kill apache manually in the clean up phase
poll: 0
when: ansible_os_family in ['RedHat', 'Alpine']
when: ansible_os_family in ['RedHat']
2 changes: 2 additions & 0 deletions test/integration/targets/subversion/vars/Alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ subversion_packages:
- subversion
- mod_dav_svn
- apache2-webdav
- apache2-utils
- apache2-ctl
apache_user: apache
apache_group: apache
274 changes: 0 additions & 274 deletions test/support/integration/plugins/modules/htpasswd.py

This file was deleted.

0 comments on commit 09d9434

Please sign in to comment.