Tests according to: http://www.freeipa.org/page/V3/Kerberos_Flags

https://fedorahosted.org/freeipa/ticket/3831

Depends on patch pvoborni-443.
--
Petr Vobornik
From 2cbac5cde5e0b7f86919fedf20d40d5463625aab Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Thu, 15 Aug 2013 17:56:17 +0200
Subject: [PATCH] Web UI Integration tests: Kerberos Flags

Tests according to: http://www.freeipa.org/page/V3/Kerberos_Flags

https://fedorahosted.org/freeipa/ticket/3831
---
 ipatests/test_webui/test_host.py    | 21 +++++++++++++++++++++
 ipatests/test_webui/test_service.py | 31 ++++++++++++++++++++++++++++---
 2 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/ipatests/test_webui/test_host.py b/ipatests/test_webui/test_host.py
index 806f2b10409c6b6e39b7ba17d2f7c3bd34306ecc..cb697c5e032cf4cf0759419a625bde39234d749c 100644
--- a/ipatests/test_webui/test_host.py
+++ b/ipatests/test_webui/test_host.py
@@ -198,6 +198,27 @@ class test_host(host_tasks):
         self.navigate_by_breadcrumb('Hosts')
         self.delete_record(self.pkey, self.data.get('del'))
 
+    def test_kerberos_flags(self):
+        """
+        Test Kerberos flags
+        http://www.freeipa.org/page/V3/Kerberos_Flags
+        """
+        pkey = self.config.get('ipa_server')
+        name = 'ipakrbokasdelegate'
+        mod = {'mod': [('checkbox', name, '')]}
+        checked = ['checked']
+
+        self.init_app()
+        self.navigate_to_record(pkey, entity=ENTITY)
+
+        if self.get_field_checked(name) == checked:
+            self.mod_record(ENTITY, mod)  # uncheck
+
+        self.mod_record(ENTITY, mod)
+        self.validate_fields([('checkbox', name, checked)])
+        self.mod_record(ENTITY, mod)
+        self.validate_fields([('checkbox', name, [])])
+
     def test_associations(self):
         """
         Host direct associations
diff --git a/ipatests/test_webui/test_service.py b/ipatests/test_webui/test_service.py
index fc64c6db5d5b79e7e7c2e988fa0f0c4c61b911a9..d2e7ad77297b2dff03aa6ee262db0dbfc34230da 100644
--- a/ipatests/test_webui/test_service.py
+++ b/ipatests/test_webui/test_service.py
@@ -51,6 +51,12 @@ class sevice_tasks(UI_driver):
             csr = csr_file.read()
         return csr
 
+    def get_http_pkey(self):
+        host = self.config.get('ipa_server')
+        realm = self.config.get('ipa_realm')
+        pkey = 'HTTP/%s@%s' % (host, realm)
+        return pkey
+
 
 class test_service(sevice_tasks):
 
@@ -158,10 +164,29 @@ class test_service(sevice_tasks):
 
         # test HTTP, which should have cert set by default and so 'view' and 'get'
         # actions visible and enabled
-        host = self.config.get('ipa_server')
-        realm = self.config.get('ipa_realm')
-        pkey = 'HTTP/%s@%s' % (host, realm)
+        pkey = self.get_http_pkey()
 
         self.navigate_to_record(pkey)
         self.assert_action_panel_action(panel, 'view_cert')
         self.assert_action_panel_action(panel, 'get_cert')
+
+    def test_kerberos_flags(self):
+        """
+        Test Kerberos flags
+        http://www.freeipa.org/page/V3/Kerberos_Flags
+        """
+        pkey = self.get_http_pkey()
+        name = 'ipakrbokasdelegate'
+        mod = {'mod': [('checkbox', name, '')]}
+        checked = ['checked']
+
+        self.init_app()
+        self.navigate_to_record(pkey, entity=ENTITY)
+
+        if self.get_field_checked(name) == checked:
+            self.mod_record(ENTITY, mod)  # uncheck
+
+        self.mod_record(ENTITY, mod)
+        self.validate_fields([('checkbox', name, checked)])
+        self.mod_record(ENTITY, mod)
+        self.validate_fields([('checkbox', name, [])])
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to