diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/zfs-tests/tests/functional/pam/.gitignore | 1 | ||||
-rw-r--r-- | tests/zfs-tests/tests/functional/pam/Makefile.am | 3 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/pam/cleanup.ksh | 6 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/pam/setup.ksh | 1 | ||||
-rw-r--r-- | tests/zfs-tests/tests/functional/pam/utilities.kshlib.in (renamed from tests/zfs-tests/tests/functional/pam/utilities.kshlib) | 13 |
5 files changed, 13 insertions, 11 deletions
diff --git a/tests/zfs-tests/tests/functional/pam/.gitignore b/tests/zfs-tests/tests/functional/pam/.gitignore new file mode 100644 index 000000000..ae55292b0 --- /dev/null +++ b/tests/zfs-tests/tests/functional/pam/.gitignore @@ -0,0 +1 @@ +/utilities.kshlib diff --git a/tests/zfs-tests/tests/functional/pam/Makefile.am b/tests/zfs-tests/tests/functional/pam/Makefile.am index be881facc..2ae5f8ff0 100644 --- a/tests/zfs-tests/tests/functional/pam/Makefile.am +++ b/tests/zfs-tests/tests/functional/pam/Makefile.am @@ -6,3 +6,6 @@ dist_pkgdata_SCRIPTS = \ pam_nounmount.ksh \ pam_short_password.ksh \ utilities.kshlib + +% : %.in + sed 's|@pammoduledir[@]|@pammoduledir@|g' $< > $@ diff --git a/tests/zfs-tests/tests/functional/pam/cleanup.ksh b/tests/zfs-tests/tests/functional/pam/cleanup.ksh index e41622d77..8ea9c848b 100755 --- a/tests/zfs-tests/tests/functional/pam/cleanup.ksh +++ b/tests/zfs-tests/tests/functional/pam/cleanup.ksh @@ -26,8 +26,4 @@ rmconfig destroy_pool $TESTPOOL del_user ${username} del_group pamtestgroup - -rm -rf "$runstatedir" -for dir in $TESTDIRS; do - rm -rf $dir -done +log_must rm -rf "$runstatedir" $TESTDIRS diff --git a/tests/zfs-tests/tests/functional/pam/setup.ksh b/tests/zfs-tests/tests/functional/pam/setup.ksh index 8ef9fbe0f..82370a211 100755 --- a/tests/zfs-tests/tests/functional/pam/setup.ksh +++ b/tests/zfs-tests/tests/functional/pam/setup.ksh @@ -23,6 +23,7 @@ . $STF_SUITE/tests/functional/pam/utilities.kshlib command -v pamtester > /dev/null || log_unsupported "pam tests require the pamtester utility to be installed" +[ -f "$pammodule" ] || log_unsupported "$pammodule missing" DISK=${DISKS%% *} create_pool $TESTPOOL "$DISK" diff --git a/tests/zfs-tests/tests/functional/pam/utilities.kshlib b/tests/zfs-tests/tests/functional/pam/utilities.kshlib.in index 6e9f90091..29c6ada3d 100644 --- a/tests/zfs-tests/tests/functional/pam/utilities.kshlib +++ b/tests/zfs-tests/tests/functional/pam/utilities.kshlib.in @@ -24,24 +24,25 @@ username="pamtestuser" runstatedir="${TESTDIR}_run" +pammodule="@pammoduledir@/pam_zfs_key.so" pamservice="pam_zfs_key_test" pamconfig="/etc/pam.d/${pamservice}" function keystatus { - log_must [ "$(zfs list -Ho keystatus "$TESTPOOL/pam/${username}")" = "$1" ] + log_must [ "$(get_prop keystatus "$TESTPOOL/pam/${username}")" = "$1" ] } function genconfig { - for i in password auth session; do - printf "%s\trequired\tpam_permit.so\n%s\toptional\tpam_zfs_key.so\t%s\n" "$i" "$i" "$1" - done > "${pamconfig}" + printf '%s\trequired\tpam_permit.so\n%s\toptional\t%s\t%s\n' \ + password password "$pammodule" "$1" \ + auth auth "$pammodule" "$1" \ + session session "$pammodule" "$1" > "${pamconfig}" } function rmconfig { - log_must rm "${pamconfig}" + log_must rm -f "${pamconfig}" } function references { log_must [ "$(<"${runstatedir}/$(id -u ${username})")" = "$1" ] } - |