test: enable user test for alpine (#84644)

* test: enable user test for alpine

* Disable user home update tests

* Disable some more tests which are not applicable for Alpine

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/84707/head
Abhijeet Kasurde 10 months ago committed by GitHub
parent d049e7b1b3
commit d0110ff691
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,34 +1,17 @@
# Test code for the user module.
# (c) 2017, James Tanner <tanner.jc@gmail.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
- name: skip broken distros
meta: end_host
when: ansible_distribution == 'Alpine'
# Copyright: (c) 2017, James Tanner <tanner.jc@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- import_tasks: test_create_user.yml
- import_tasks: test_create_system_user.yml
- import_tasks: test_create_user_uid.yml
- import_tasks: test_create_user_password.yml
- import_tasks: test_create_user_home.yml
- include_tasks: test_create_user_home.yml
when: ansible_distribution != 'Alpine'
- import_tasks: test_remove_user.yml
- import_tasks: test_no_home_fallback.yml
- import_tasks: test_expires.yml
- include_tasks: test_expires.yml
when: ansible_distribution != 'Alpine'
- import_tasks: test_expires_new_account.yml
- import_tasks: test_expires_new_account_epoch_negative.yml
- import_tasks: test_expires_no_shadow.yml
@ -36,13 +19,21 @@
- import_tasks: test_expires_warn.yml
- import_tasks: test_shadow_backup.yml
- import_tasks: test_ssh_key_passphrase.yml
- import_tasks: test_password_lock.yml
- import_tasks: test_password_lock_new_user.yml
- include_tasks: test_password_lock.yml
when: ansible_distribution != 'Alpine'
- include_tasks: test_password_lock_new_user.yml
when: ansible_distribution != 'Alpine'
- include_tasks: test_local.yml
when: not (ansible_distribution == 'openSUSE Leap' and ansible_distribution_version is version('15.4', '>='))
when:
- not (ansible_distribution == 'openSUSE Leap' and ansible_distribution_version is version('15.4', '>='))
- ansible_distribution != 'Alpine'
- include_tasks: test_umask.yml
when: ansible_facts.system == 'Linux'
when:
- ansible_facts.system == 'Linux'
- ansible_distribution != 'Alpine'
- import_tasks: test_inactive_new_account.yml
- include_tasks: test_create_user_min_max.yml
when: ansible_facts.system == 'Linux'
when:
- ansible_facts.system == 'Linux'
- ansible_distribution != 'Alpine'
- import_tasks: ssh_keygen.yml

@ -33,6 +33,8 @@
shell: |
import re
import os
umask = os.umask(0)
mode = oct(0o777 & ~umask)
try:
for line in open('/etc/login.defs').readlines():
m = re.match(r'^HOME_MODE\s+(\d+)$', line)
@ -44,8 +46,7 @@
umask = int(m.group(1), 8)
mode = oct(0o777 & ~umask)
except:
umask = os.umask(0)
mode = oct(0o777 & ~umask)
pass
print(str(mode).replace('o', ''))
args:
executable: "{{ ansible_python_interpreter }}"

Loading…
Cancel
Save