summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup.py2
-rw-r--r--src/idp_test/__init__.py12
-rw-r--r--src/idp_test/check.py3
-rw-r--r--src/idp_test/package/__init__.py1
-rw-r--r--src/idp_test/package/authn_request.py (renamed from src/idp_test/authn_request_test.py)4
5 files changed, 12 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index 404c8da6..b992a14f 100644
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,7 @@ setup(
author = "Roland Hedberg",
author_email = "roland.hedberg@adm.umu.se",
license="Apache 2.0",
- packages=["idp_test"],
+ packages=["idp_test", "idp_test/package"],
package_dir = {"": "src"},
classifiers = ["Development Status :: 4 - Beta",
"License :: OSI Approved :: Apache Software License",
diff --git a/src/idp_test/__init__.py b/src/idp_test/__init__.py
index 4c16b606..958e1574 100644
--- a/src/idp_test/__init__.py
+++ b/src/idp_test/__init__.py
@@ -114,8 +114,8 @@ class SAML2client(object):
help="Configuration file for the SP")
self._parser.add_argument("-P", dest="configpath", default=".",
help="Path to the configuration file for the SP")
- self._parser.add_argument("-t", dest="testdefs",
- help="Module describing the tests")
+ self._parser.add_argument("-t", dest="testpackage",
+ help="Module describing tests")
self._parser.add_argument("oper", nargs="?", help="Which test to run")
self.interactions = None
@@ -150,8 +150,8 @@ class SAML2client(object):
metadata[0] = md
self.sp_config.metadata = metadata
- if self.args.testdefs:
- self.tests = import_module("idp_test.%s" % self.args.testdefs)
+ if self.args.testpackage:
+ self.tests = import_module("idp_test.package.%s" % self.args.testpackage)
try:
self.entity_id = _jc["entity_id"]
@@ -254,8 +254,8 @@ class SAML2client(object):
pass
lista.append(item)
- if self.args.testdefs:
- mod = import_module(self.args.testdefs, "idp_test")
+ if self.args.testpackage:
+ mod = import_module(self.args.testpackage, "idp_test")
for key,val in mod.OPERATIONS.items():
item = {"id": key,
"name": val["name"],}
diff --git a/src/idp_test/check.py b/src/idp_test/check.py
index f9407cc7..fbe51f1d 100644
--- a/src/idp_test/check.py
+++ b/src/idp_test/check.py
@@ -1,6 +1,7 @@
import inspect
import sys
import traceback
+from saml2.mdstore import REQ2SRV
from saml2.s_utils import UnknownPrincipal, UnsupportedBinding
from saml2.saml import NAMEID_FORMAT_TRANSIENT, NAMEID_FORMAT_PERSISTENT
from saml2.saml import NAME_FORMAT_URI
@@ -523,7 +524,7 @@ class VerifyFunctionality(Check):
def _func(self, environ):
oper = environ["op"]
args = environ["oper.args"]
- res = self._srv_support(environ, oper.request)
+ res = self._srv_support(environ, REQ2SRV[oper.request])
if self._status != "OK":
return res
diff --git a/src/idp_test/package/__init__.py b/src/idp_test/package/__init__.py
new file mode 100644
index 00000000..3b031d2b
--- /dev/null
+++ b/src/idp_test/package/__init__.py
@@ -0,0 +1 @@
+__author__ = 'rolandh'
diff --git a/src/idp_test/authn_request_test.py b/src/idp_test/package/authn_request.py
index 668a6894..e4b26915 100644
--- a/src/idp_test/authn_request_test.py
+++ b/src/idp_test/package/authn_request.py
@@ -18,13 +18,13 @@ class DummyExtension(SamlBase):
c_cardinality = SamlBase.c_cardinality.copy()
class AuthnRequest_UnknownIssuer(AuthnRequest):
- def pre_processing(self, environ, message, args):
+ def pre_processing(self, message, args):
_issuer = message.issuer
_issuer.text = "https://www.example.com/foobar.xml"
return message
class AuthnRequest_UnknownExtension(AuthnRequest):
- def pre_processing(self, environ, message, args):
+ def pre_processing(self, message, args):
message.extension = ExtensionContainer()
message.extension.add_extension_element(DummyExtension(text="foo"))
return message