diff options
author | Rob Crittenden <rcritten@redhat.com> | 2015-03-19 15:20:28 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2015-03-23 17:39:27 -0400 |
commit | a1b380865b4068eb5ed48204c041c3def09dc463 (patch) | |
tree | 3b84e6a0eb5e8164b5e3ec02579a4a89697681b8 /tests/helpers | |
parent | d04f6d2bf4842d18a66325be4caa83ac2820330d (diff) | |
download | ipsilon.git-a1b380865b4068eb5ed48204c041c3def09dc463.tar.gz ipsilon.git-a1b380865b4068eb5ed48204c041c3def09dc463.tar.xz ipsilon.git-a1b380865b4068eb5ed48204c041c3def09dc463.zip |
Add tests for Name ID functionalitynameid_policy
Some Name ID formats are not implemented so are expected to fail.
Kerberos is implemented but the test is done using form authentication
so no Kerberos principal is available so authentication is denied.
https://fedorahosted.org/ipsilon/ticket/27
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Diffstat (limited to 'tests/helpers')
-rwxr-xr-x | tests/helpers/common.py | 4 | ||||
-rwxr-xr-x | tests/helpers/http.py | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/helpers/common.py b/tests/helpers/common.py index 07a41fe..54702be 100755 --- a/tests/helpers/common.py +++ b/tests/helpers/common.py @@ -55,7 +55,8 @@ class IpsilonTestBase(object): os.mkdir(os.path.join(self.testdir, 'lib', test.name)) os.mkdir(os.path.join(self.testdir, 'log')) - def generate_profile(self, global_opts, args_opts, name, addr, port): + def generate_profile(self, global_opts, args_opts, name, addr, port, + nameid='transient'): newconf = ConfigParser.ConfigParser() newconf.add_section('globals') for k in global_opts.keys(): @@ -71,6 +72,7 @@ class IpsilonTestBase(object): text = t.substitute({'NAME': name, 'ADDRESS': addr, 'PORT': port, 'TESTDIR': self.testdir, 'ROOTDIR': self.rootdir, + 'NAMEID': nameid, 'TEST_USER': self.testuser}) filename = os.path.join(self.testdir, '%s_profile.cfg' % name) diff --git a/tests/helpers/http.py b/tests/helpers/http.py index cf59853..d8c56b3 100755 --- a/tests/helpers/http.py +++ b/tests/helpers/http.py @@ -266,6 +266,22 @@ class HttpSessions(object): page.expected_value('//div[@class="alert alert-success"]/p/text()', 'SP Successfully added') + def set_sp_default_nameids(self, idp, sp, nameids): + """ + nameids is a list of Name ID formats to enable + """ + idpsrv = self.servers[idp] + idpuri = idpsrv['baseuri'] + url = '%s/%s/admin/providers/saml2/admin/sp/%s' % (idpuri, idp, sp) + headers = {'referer': url} + headers['content-type'] = 'application/x-www-form-urlencoded' + payload = {'submit': 'Submit', + 'allowed_nameids': ', '.join(nameids)} + r = idpsrv['session'].post(url, headers=headers, + data=payload) + if r.status_code != 200: + raise ValueError('Failed to post SP data [%s]' % repr(r)) + def fetch_rest_page(self, idpname, uri): """ idpname - the name of the IDP to fetch the page from |