Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly reset timezone in user integration test when it was originally "n/a" #55389

Merged
merged 1 commit into from
Apr 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions test/integration/targets/user/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,17 @@
state: present
expires: 2529881062
register: user_test_expires1
tags:
- timezone

- name: Set user expiration again to ensure no change is made
user:
name: ansibulluser
state: present
expires: 2529881062
register: user_test_expires2
tags:
- timezone

- name: Ensure that account with expiration was created and did not change on subsequent run
assert:
Expand Down Expand Up @@ -382,16 +386,31 @@
state: present
expires: 2529881062
register: user_test_different_tz
tags:
- timezone

- name: Ensure that no change was reported
assert:
that:
- user_test_different_tz is not changed
tags:
- timezone

always:
- name: Restore original timezone - {{ original_timezone.diff.before.name }}
timezone:
name: "{{ original_timezone.diff.before.name }}"
when: original_timezone.diff.before.name != "n/a"
tags:
- timezone

- name: Restore original timezone when n/a
file:
path: /etc/sysconfig/clock
state: absent
when:
- original_timezone.diff.before.name == "n/a"
- "'/etc/sysconfig/clock' in original_timezone.msg"
tags:
- timezone

Expand Down