summaryrefslogtreecommitdiffstats
path: root/ipatests/test_xmlrpc/test_service_plugin.py
diff options
context:
space:
mode:
authorLenka Doudova <ldoudova@redhat.com>2016-06-15 13:44:16 +0200
committerPetr Vobornik <pvoborni@redhat.com>2016-07-15 13:57:18 +0200
commitdcdbbb975927a24ec05f7addefd59c71823a57c2 (patch)
treea8680a1d644d0dddd70588c3588707211fc10b58 /ipatests/test_xmlrpc/test_service_plugin.py
parent0f9a5ce6b4c533647b8894f516e34bea8184f1b8 (diff)
downloadfreeipa-dcdbbb975927a24ec05f7addefd59c71823a57c2.tar.gz
freeipa-dcdbbb975927a24ec05f7addefd59c71823a57c2.tar.xz
freeipa-dcdbbb975927a24ec05f7addefd59c71823a57c2.zip
Tests: Authentication indicators xmlrpc tests
https://fedorahosted.org/freeipa/ticket/433 Reviewed-By: Milan Kubik <mkubik@redhat.com>
Diffstat (limited to 'ipatests/test_xmlrpc/test_service_plugin.py')
-rw-r--r--ipatests/test_xmlrpc/test_service_plugin.py45
1 files changed, 44 insertions, 1 deletions
diff --git a/ipatests/test_xmlrpc/test_service_plugin.py b/ipatests/test_xmlrpc/test_service_plugin.py
index 54ae55963..56e2c7a7a 100644
--- a/ipatests/test_xmlrpc/test_service_plugin.py
+++ b/ipatests/test_xmlrpc/test_service_plugin.py
@@ -24,10 +24,14 @@ Test the `ipaserver/plugins/service.py` module.
from ipalib import api, errors, x509
from ipatests.test_xmlrpc.xmlrpc_test import Declarative, fuzzy_uuid, fuzzy_hash
from ipatests.test_xmlrpc.xmlrpc_test import fuzzy_digits, fuzzy_date, fuzzy_issuer
-from ipatests.test_xmlrpc.xmlrpc_test import fuzzy_hex
+from ipatests.test_xmlrpc.xmlrpc_test import fuzzy_hex, XMLRPC_test
from ipatests.test_xmlrpc import objectclasses
from ipatests.test_xmlrpc.testcert import get_testcert
from ipatests.test_xmlrpc.test_user_plugin import get_user_result, get_group_dn
+
+from ipatests.test_xmlrpc.tracker.service_plugin import ServiceTracker
+from ipatests.test_xmlrpc.tracker.host_plugin import HostTracker
+
import base64
from ipapython.dn import DN
import pytest
@@ -1262,3 +1266,42 @@ class test_service_allowed_to(Declarative):
),
),
]
+
+
+@pytest.fixture(scope='function')
+def indicators_host(request):
+ tracker = HostTracker(name=u'testhost1', fqdn=fqdn1)
+ return tracker.make_fixture(request)
+
+
+@pytest.fixture(scope='function')
+def indicators_service(request):
+ tracker = ServiceTracker(
+ name=u'SRV1', host_fqdn=fqdn1, options={
+ u'krbprincipalauthind': u'otp'})
+ return tracker.make_fixture(request)
+
+
+@pytest.mark.tier1
+class TestAuthenticationIndicators(XMLRPC_test):
+ def test_create_service_with_otp_indicator(
+ self, indicators_host, indicators_service):
+ """ Since range of authentication indicator values is not limited,
+ only 'otp' option is tested """
+ indicators_host.create()
+ indicators_service.create()
+
+ def test_adding_second_indicator(
+ self, indicators_host, indicators_service):
+ indicators_host.create()
+ indicators_service.create()
+ indicators_service.update(
+ updates={u'krbprincipalauthind': [u'otp', u'radius']})
+
+ def test_update_indicator(self, indicators_host, indicators_service):
+ indicators_host.create()
+ indicators_service.create()
+ indicators_service.update(
+ updates={u'krbprincipalauthind': u'radius'},
+ expected_updates={u'krbprincipalauthind': [u'radius']}
+ )