URL: https://github.com/freeipa/freeipa/pull/705
Author: redhatrises
 Title: #705: ipatests: Add krbpasswordexpiration tests
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/705/head:pr705
git checkout pr705
From be913cd2ab08c76aaba3b690438bd68143c57748 Mon Sep 17 00:00:00 2001
From: Gabe <redhatri...@gmail.com>
Date: Mon, 10 Apr 2017 11:29:42 -0600
Subject: [PATCH] ipatests: Add krbpasswordexpiration tests

---
 ipatests/test_xmlrpc/test_user_plugin.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/ipatests/test_xmlrpc/test_user_plugin.py b/ipatests/test_xmlrpc/test_user_plugin.py
index 098163d..6d786d6 100644
--- a/ipatests/test_xmlrpc/test_user_plugin.py
+++ b/ipatests/test_xmlrpc/test_user_plugin.py
@@ -68,6 +68,7 @@
     u'en-us;q=0.1234', u'en-us;q=1.1', u'en-us;q=1.0000'
     }
 
+password_expiration_now = datetime.datetime.utcnow()
 principal_expiration_string = "2020-12-07T19:54:13Z"
 principal_expiration_date = datetime.datetime(2020, 12, 7, 19, 54, 13)
 
@@ -439,6 +440,23 @@ def test_set_random_password(self, user):
         )
         user.delete()
 
+    def test_set_immediate_password_expiration(self, user):
+        """ Set immediate password expiration for user """
+        user.ensure_exists()
+        command = user.make_update_command(
+            updates=dict(krbpasswordexpiration=u'now')
+        )
+        result = command()
+        user.check_update(result)
+
+    def test_set_delayed_password_expiration(self, user):
+        """ Set delayed expiration for user """
+        user.ensure_exists()
+        user.update(
+            dict(krbpasswordexpiration=principal_expiration_string),
+            dict(krbpasswordexpiration=[principal_expiration_date])
+        )
+
     def test_rename_to_invalid_login(self, user):
         """ Try to change user login to an invalid value """
         user.ensure_exists()
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to