Skip to content

Commit

Permalink
ci: Add a basic test for ad_integration_preserve_authselect_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-vavra-cz authored and richm committed Jan 23, 2024
1 parent 5063d7f commit ee62490
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/tests_preserve_authselect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-License-Identifier: MIT
---
- name: Ensure that the role ad_integration_preserve_authselect_profile works
hosts: all,!ad
gather_facts: false # test that role works in this case
vars:
# sample realm that will skip joining realm step
ad_integration_realm: "{{ __ad_integration_sample_realm }}"
ad_integration_password: Secret123
ad_integration_preserve_authselect_profile: true

tasks:
- name: Test - Run the system role
include_role:
name: linux-system-roles.ad_integration

- name: Test - Check that realmd config is present
stat:
path: /etc/realmd.conf
register: __stat_result
failed_when: not __stat_result.stat.exists
changed_when: false

- name: Get realmd.conf
slurp:
path: /etc/realmd.conf
register: realmd_conf_raw

- name: Decode realmd.conf
set_fact:
realmd_conf: "{{ realmd_conf_raw.content | b64decode }}"

- name: Test - Check that expected strings are in realmd.conf
assert:
that:
- "'sssd-enable-logins = /usr/bin/sh' in realmd_conf"
- "'sssd-disable-logins = /bin/true' in realmd_conf"

0 comments on commit ee62490

Please sign in to comment.