From ff346a199c3e3ca0c54b3e9a656f7105b3e55cb0 Mon Sep 17 00:00:00 2001 From: nitzmahone Date: Tue, 17 May 2016 13:40:40 -0700 Subject: [PATCH] fix windows integration tests to run under kerberos users --- test/integration/roles/test_win_get_url/defaults/main.yml | 3 +-- test/integration/roles/test_win_get_url/tasks/main.yml | 8 ++++++++ test/integration/roles/test_win_script/defaults/main.yml | 1 - test/integration/roles/test_win_script/tasks/main.yml | 8 ++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/test/integration/roles/test_win_get_url/defaults/main.yml b/test/integration/roles/test_win_get_url/defaults/main.yml index 6e507ecf31c..c7a90e599f9 100644 --- a/test/integration/roles/test_win_get_url/defaults/main.yml +++ b/test/integration/roles/test_win_get_url/defaults/main.yml @@ -1,7 +1,6 @@ --- test_win_get_url_link: http://docs.ansible.com -test_win_get_url_path: "C:\\Users\\{{ansible_ssh_user}}\\docs_index.html" test_win_get_url_invalid_link: http://docs.ansible.com/skynet_module.html test_win_get_url_invalid_path: "Q:\\Filez\\Cyberdyne.html" -test_win_get_url_dir_path: "C:\\Users\\{{ansible_ssh_user}}" +test_win_get_url_path: "{{ test_win_get_url_dir_path }}\\docs_index.html" \ No newline at end of file diff --git a/test/integration/roles/test_win_get_url/tasks/main.yml b/test/integration/roles/test_win_get_url/tasks/main.yml index b0705eabd56..52e49672d27 100644 --- a/test/integration/roles/test_win_get_url/tasks/main.yml +++ b/test/integration/roles/test_win_get_url/tasks/main.yml @@ -16,6 +16,14 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . +- name: get tempdir path + raw: $env:TEMP + register: tempdir + +- name: set output path dynamically + set_fact: + test_win_get_url_dir_path: "{{ tempdir.stdout_lines[0] }}" + - name: remove test file if it exists raw: > PowerShell -Command Remove-Item "{{test_win_get_url_path}}" -Force diff --git a/test/integration/roles/test_win_script/defaults/main.yml b/test/integration/roles/test_win_script/defaults/main.yml index 90b756af0ab..a2c6475e751 100644 --- a/test/integration/roles/test_win_script/defaults/main.yml +++ b/test/integration/roles/test_win_script/defaults/main.yml @@ -3,4 +3,3 @@ # Parameters to pass to test scripts. test_win_script_value: VaLuE test_win_script_splat: "@{This='THIS'; That='THAT'; Other='OTHER'}" -test_win_script_filename: "C:/Users/{{ansible_ssh_user}}/testing_win_script.txt" diff --git a/test/integration/roles/test_win_script/tasks/main.yml b/test/integration/roles/test_win_script/tasks/main.yml index 46f91f13f88..6cfa84ec004 100644 --- a/test/integration/roles/test_win_script/tasks/main.yml +++ b/test/integration/roles/test_win_script/tasks/main.yml @@ -16,6 +16,14 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . +- name: get tempdir path + raw: $env:TEMP + register: tempdir + +- name: set script path dynamically + set_fact: + test_win_script_filename: "{{ tempdir.stdout_lines[0] }}/testing_win_script.txt" + - name: run simple test script script: test_script.ps1 register: test_script_result