Skip to content

Commit

Permalink
test: delete kdump user last, retry until success
Browse files Browse the repository at this point in the history
Some tests fail like this:
```
TASK [Delete user] *************************************************************
fatal: [/tmp/tmp.cgsy6Vmlnz/RHEL_8_9_TESTING.qcow2]: FAILED! => {
    "changed": false,
    "name": "kdump_ssh_user",
    "rc": 8
}

userdel: user kdump_ssh_user is currently used by process 23050
```

Move the deletion of the user to the last part of the test, and retry
until success or timeout.

Signed-off-by: Rich Megginson <[email protected]>
  • Loading branch information
richm committed Sep 12, 2023
1 parent ce322fe commit d02f189
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/tests_ssh_reboot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@
include_role:
name: linux-system-roles.kdump

- name: Delete user
user:
name: "{{ kdump_ssh_user }}"
state: absent

- name: Get the authorized_keys contents after
slurp:
src: "{{ __authorized_keys_file.stat.path }}"
Expand All @@ -151,3 +146,10 @@
- __ssh_dir_stat_before.stat.mode == __ssh_dir_stat_after.stat.mode
- __ssh_dir_stat_before.stat.uid == __ssh_dir_stat_after.stat.uid
- __ssh_dir_stat_before.stat.gid == __ssh_dir_stat_after.stat.gid

- name: Delete user
user:
name: "{{ kdump_ssh_user }}"
state: absent
register: __user_delete
until: __user_delete is success

0 comments on commit d02f189

Please sign in to comment.