[shibboleth-sp2] 81/82: SPCPP-756 MDQ test

Etienne Dysli Metref edm-guest at moszumanska.debian.org
Thu Nov 16 08:16:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

edm-guest pushed a commit to branch master
in repository shibboleth-sp2.

commit 932ff44fdca30a4fe9b06ad62e78c4e279c37050
Author: Rod Widdowson <rdw at steadingsoftware.com>
Date:   Mon Oct 23 11:23:46 2017 +0100

    SPCPP-756 MDQ test
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-756
---
 unittests/DynamicMetadataProviderTest.h | 34 ++++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/unittests/DynamicMetadataProviderTest.h b/unittests/DynamicMetadataProviderTest.h
index 9a642da..c63e85e 100644
--- a/unittests/DynamicMetadataProviderTest.h
+++ b/unittests/DynamicMetadataProviderTest.h
@@ -150,9 +150,10 @@ public:
         performTest("staticFromFile.xml", true, XML_METADATA_PROVIDER);
     }
 
-/* WIP
 
-    void MDQ() {
+private:
+    void mdqTest(bool artifactOnly)
+    {
         string config = data_path + "fromMDQ.xml";
         ifstream in(config.c_str());
         XMLToolingConfig& xcf = XMLToolingConfig::getConfig();
@@ -163,23 +164,34 @@ public:
         );
 
         ta::TestApplication testApp(SPConfig::getConfig().getServiceProvider(), metadataProvider.get());
-        MetadataProviderCriteria crit(testApp, m_entityId.c_str());
+        const string testEntity("https://foo1.example.org/idp/shibboleth");
         try {
             metadataProvider->init();
-            pair<const EntityDescriptor*, const RoleDescriptor*>  thePair = metadataProvider->getEntityDescriptor(crit);
-            TS_ASSERT(nullptr != thePair.first);
+            if (!artifactOnly) {
+                MetadataProviderCriteria crit(testApp, testEntity.c_str());
+                pair<const EntityDescriptor*, const RoleDescriptor*>  thePair = metadataProvider->getEntityDescriptor(crit);
+                TS_ASSERT(nullptr != thePair.first);
+            }
 
-            MetadataProviderCriteria artifactCrit(testApp, m_artifact.get());
+            auto_ptr<SAML2ArtifactType0004> testArtifact(new SAML2ArtifactType0004(SecurityHelper::doHash("SHA1", testEntity.data(), testEntity.length(), false), 666));
+            MetadataProviderCriteria artifactCrit(testApp, testArtifact.get());
             pair<const EntityDescriptor*, const RoleDescriptor*>  artefactPair = metadataProvider->getEntityDescriptor(artifactCrit);
             TS_ASSERT(nullptr != artefactPair.first);
-            if (nullptr != artefactPair.first)
-                fprintf(stderr, "ei : %s\n", (artefactPair.first)->getEntityID());
-        }
-        catch (XMLToolingException& ex) {
+        } catch (XMLToolingException& ex) {
             TS_TRACE(ex.what());
             throw;
         }
     }
-    */
+
+public:
+    void testMDQ()
+    {
+        mdqTest(false);
+    }
+
+    void testMDQArtifactOnly ()
+    {
+        mdqTest(true);
+    }
 
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/shibboleth-sp2.git



More information about the Pkg-shibboleth-devel mailing list