From 74d83d8e94cab6d72755b3a5b8a476ca49f68d85 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 31 Mar 2020 10:52:24 +0200 Subject: [PATCH] supervisorctl tests: shorten path to .sock file to make OSX happy. (#77) --- tests/integration/targets/supervisorctl/aliases | 1 - tests/integration/targets/supervisorctl/tasks/main.yml | 9 +++++++++ .../targets/supervisorctl/tasks/test_stop.yml | 8 ++++---- .../targets/supervisorctl/templates/supervisord.conf | 4 ++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/integration/targets/supervisorctl/aliases b/tests/integration/targets/supervisorctl/aliases index caea9d20f5..1dbdd80109 100644 --- a/tests/integration/targets/supervisorctl/aliases +++ b/tests/integration/targets/supervisorctl/aliases @@ -2,4 +2,3 @@ destructive shippable/posix/group2 skip/python3 skip/aix -disabled #fixme diff --git a/tests/integration/targets/supervisorctl/tasks/main.yml b/tests/integration/targets/supervisorctl/tasks/main.yml index 38846b1c9f..3fcb432e65 100644 --- a/tests/integration/targets/supervisorctl/tasks/main.yml +++ b/tests/integration/targets/supervisorctl/tasks/main.yml @@ -1,4 +1,9 @@ - block: + - tempfile: + state: directory + suffix: supervisorctl-tests + register: supervisord_sock_path + - command: 'echo {{ output_dir }}' register: echo - set_fact: @@ -36,3 +41,7 @@ - 'uninstall_{{ ansible_distribution }}.yml' # CentOS - 'uninstall_{{ ansible_os_family }}.yml' # RedHat - 'uninstall_{{ ansible_system }}.yml' # Linux + + - file: + path: '{{ supervisord_sock_path.path }}' + state: absent diff --git a/tests/integration/targets/supervisorctl/tasks/test_stop.yml b/tests/integration/targets/supervisorctl/tasks/test_stop.yml index faf6d79358..5c76a6813c 100644 --- a/tests/integration/targets/supervisorctl/tasks/test_stop.yml +++ b/tests/integration/targets/supervisorctl/tasks/test_stop.yml @@ -3,7 +3,7 @@ name: 'pys:py1' state: stopped # test with 'server_url' parameter - server_url: 'unix://{{ remote_dir }}/supervisord.sock' + server_url: 'unix://{{ supervisord_sock_path.path }}/supervisord.sock' register: result when: credentials.username == '' @@ -12,7 +12,7 @@ name: 'pys:py1' state: stopped # test with unix socket - server_url: 'unix://{{ remote_dir }}/supervisord.sock' + server_url: 'unix://{{ supervisord_sock_path.path }}/supervisord.sock' username: '{{ credentials.username }}' password: '{{ credentials.password }}' register: result_with_auth @@ -37,7 +37,7 @@ name: pys:py1 state: stopped # test with 'server_url' parameter - server_url: 'unix://{{ remote_dir }}/supervisord.sock' + server_url: 'unix://{{ supervisord_sock_path.path }}/supervisord.sock' register: result when: credentials.username == '' @@ -46,7 +46,7 @@ name: pys:py1 state: stopped # test with unix socket - server_url: 'unix://{{ remote_dir }}/supervisord.sock' + server_url: 'unix://{{ supervisord_sock_path.path }}/supervisord.sock' username: '{{ credentials.username }}' password: '{{ credentials.password }}' register: result_with_auth diff --git a/tests/integration/targets/supervisorctl/templates/supervisord.conf b/tests/integration/targets/supervisorctl/templates/supervisord.conf index 2e805bd8d9..2f80e02b72 100644 --- a/tests/integration/targets/supervisorctl/templates/supervisord.conf +++ b/tests/integration/targets/supervisorctl/templates/supervisord.conf @@ -22,7 +22,7 @@ redirect_stderr=yes programs=py1,py2 [unix_http_server] -file={{ remote_dir }}/supervisord.sock +file={{ supervisord_sock_path.path }}/supervisord.sock {% if credentials.username is defined and credentials.username|default(false, boolean=true) %} username = {{ credentials.username }} password = {{ credentials.password }} @@ -36,7 +36,7 @@ password = {{ credentials.password }} {% endif %} [supervisorctl] -serverurl=unix://{{ remote_dir }}/supervisord.sock +serverurl=unix://{{ supervisord_sock_path.path }}/supervisord.sock [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface