From 8a7bcc05b42bcecd4490499a892ed07f15e916df Mon Sep 17 00:00:00 2001 From: Edgar Aguilar Date: Thu, 18 Jan 2024 17:04:12 -0600 Subject: [PATCH] Add tests to OL8 sssd rules These test are to take int account files inside /etc/sssd/conf.d/ Signed-off-by: Edgar Aguilar --- .../tests/authselect_smartcard_enabled_conf_d.pass.sh | 11 +++++++++++ .../authselect_sssd_parameter_false_conf_d.fail.sh | 11 +++++++++++ .../tests/correct_value_conf_d.pass.sh | 9 +++++++++ .../tests/wrong_value_conf_d.fail.sh | 9 +++++++++ 4 files changed, 40 insertions(+) create mode 100644 linux_os/guide/services/sssd/sssd_enable_smartcards/tests/authselect_smartcard_enabled_conf_d.pass.sh create mode 100644 linux_os/guide/services/sssd/sssd_enable_smartcards/tests/authselect_sssd_parameter_false_conf_d.fail.sh create mode 100644 linux_os/guide/services/sssd/sssd_offline_cred_expiration/tests/correct_value_conf_d.pass.sh create mode 100644 linux_os/guide/services/sssd/sssd_offline_cred_expiration/tests/wrong_value_conf_d.fail.sh diff --git a/linux_os/guide/services/sssd/sssd_enable_smartcards/tests/authselect_smartcard_enabled_conf_d.pass.sh b/linux_os/guide/services/sssd/sssd_enable_smartcards/tests/authselect_smartcard_enabled_conf_d.pass.sh new file mode 100644 index 00000000000..7e2019cff1f --- /dev/null +++ b/linux_os/guide/services/sssd/sssd_enable_smartcards/tests/authselect_smartcard_enabled_conf_d.pass.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# packages = authselect,sssd +# platform = multi_platform_fedora,Oracle Linux 8,Oracle Linux 9,Red Hat Enterprise Linux 8,Red Hat Enterprise Linux 9 + +SSSD_FILE="/etc/sssd/conf.d/unused.conf" +echo "[pam]" > $SSSD_FILE +echo "pam_cert_auth = True" >> $SSSD_FILE + +authselect select sssd --force +authselect enable-feature with-smartcard +authselect apply-changes diff --git a/linux_os/guide/services/sssd/sssd_enable_smartcards/tests/authselect_sssd_parameter_false_conf_d.fail.sh b/linux_os/guide/services/sssd/sssd_enable_smartcards/tests/authselect_sssd_parameter_false_conf_d.fail.sh new file mode 100644 index 00000000000..b1ed28f3943 --- /dev/null +++ b/linux_os/guide/services/sssd/sssd_enable_smartcards/tests/authselect_sssd_parameter_false_conf_d.fail.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# packages = authselect,sssd +# platform = multi_platform_fedora,Oracle Linux 8,Oracle Linux 9,Red Hat Enterprise Linux 8,Red Hat Enterprise Linux 9 + +SSSD_FILE="/etc/sssd/conf.d/unused.conf" +echo "[pam]" > $SSSD_FILE +echo "pam_cert_auth = False" >> $SSSD_FILE + +authselect select sssd --force +authselect enable-feature with-smartcard +authselect apply-changes diff --git a/linux_os/guide/services/sssd/sssd_offline_cred_expiration/tests/correct_value_conf_d.pass.sh b/linux_os/guide/services/sssd/sssd_offline_cred_expiration/tests/correct_value_conf_d.pass.sh new file mode 100644 index 00000000000..c8927040f19 --- /dev/null +++ b/linux_os/guide/services/sssd/sssd_offline_cred_expiration/tests/correct_value_conf_d.pass.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +source common.sh + +SSSD_CONF_D_FILE="/etc/sssd/conf.d/unused.conf" + +echo -e "[pam]\noffline_credentials_expiration = 1" >> $SSSD_CONF_D_FILE + +echo -e "[domain/EXAMPLE]\ncache_credentials = true" >> $SSSD_CONF diff --git a/linux_os/guide/services/sssd/sssd_offline_cred_expiration/tests/wrong_value_conf_d.fail.sh b/linux_os/guide/services/sssd/sssd_offline_cred_expiration/tests/wrong_value_conf_d.fail.sh new file mode 100644 index 00000000000..f3185b6cd68 --- /dev/null +++ b/linux_os/guide/services/sssd/sssd_offline_cred_expiration/tests/wrong_value_conf_d.fail.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +source common.sh + +SSSD_CONF_D_FILE="/etc/sssd/conf.d/unused.conf" + +echo -e "[pam]\noffline_credentials_expiration = 0" >> $SSSD_CONF_D_FILE + +echo -e "[domain/EXAMPLE]\ncache_credentials = true" >> $SSSD_CONF