summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2011-10-10 16:25:38 +0200
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2011-10-10 16:31:00 +0200
commit627294f52c045caecaced1cf42793f2ace1f0179 (patch)
treedd44c4f5ae13af4ef78e23dfafaae869b8e43949 /tests
parent94136d639b6dd82e1a2a99e9c9af9878da9a64f2 (diff)
downloadlasso-627294f52c045caecaced1cf42793f2ace1f0179.tar.gz
lasso-627294f52c045caecaced1cf42793f2ace1f0179.tar.xz
lasso-627294f52c045caecaced1cf42793f2ace1f0179.zip
[tests] add non-regression tests concerning the parsing of any xmlNode tree by LassoMiscTextNode when SNIPPET_ANY is used by a LassoNode
Diffstat (limited to 'tests')
-rw-r--r--tests/non_regression_tests.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/non_regression_tests.c b/tests/non_regression_tests.c
index 03f6045f..b266e9dd 100644
--- a/tests/non_regression_tests.c
+++ b/tests/non_regression_tests.c
@@ -32,8 +32,11 @@
#include <../lasso/xml/lib_authentication_statement.h>
#include <../lasso/xml/saml_name_identifier.h>
#include <../lasso/xml/samlp_response.h>
+#include <../lasso/xml/saml-2.0/saml2_attribute.h>
#include <../lasso/id-ff/provider.h>
#include "../lasso/utils.h"
+#include <libxml/tree.h>
+#include <libxml/parser.h>
Suite* non_regression_suite();
@@ -137,12 +140,38 @@ START_TEST(indexed_endpoints_20101008)
}
END_TEST
+void error_log_func(G_GNUC_UNUSED const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
+ const gchar *message, G_GNUC_UNUSED gpointer user_data)
+{
+ fail_unless(FALSE, "error_func called... %s", message);
+}
+
+START_TEST(remove_warning_when_parssing_unknown_SNIPPET_LIST_NODES_20111007)
+{
+ LassoNode *node;
+ xmlDoc *xmldoc;
+ const char content[] = "<saml:Attribute Name=\"urn:oid:1.3.6.1.4.1.5923.1.1.1.10\" NameFormat=\"urn:oasis:names:tc:SAML:2.0:attrname-format:uri\" FriendlyName=\"eduPersonTargetedID\" xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\"><saml:AttributeValue><NameID Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:persistent\" NameQualifier=\"https://services-federation.renater.fr/test/idp\" SPNameQualifier=\"https://univnautes.entrouvert.lan/authsaml2/metadata\">C8NQsm1Y3Gas9m0AMDhxU7UxCSI=</NameID></saml:AttributeValue></saml:Attribute>";
+ guint log_handler;
+
+ xmldoc = xmlReadMemory(content, sizeof(content)-1, NULL, NULL, 0);
+ check_not_null(xmldoc);
+ log_handler = g_log_set_handler("Lasso", G_LOG_LEVEL_MASK, error_log_func, NULL);
+ node = lasso_node_new_from_xmlNode(xmlDocGetRootElement(xmldoc));
+ check_not_null(node);
+ check_true(LASSO_IS_SAML2_ATTRIBUTE(node));
+ g_log_remove_handler("Lasso", log_handler);
+ check_true(LASSO_IS_NODE(node));
+ xmlFreeDoc(xmldoc);
+ lasso_release_gobject(node);
+}
+END_TEST
struct {
char *name;
void *function;
} tests[] = {
{ "Googleapps error from coudot@ on 27-09-2010", test01_googleapps_27092010},
- { "Wrong assertionConsumer ordering on 08-10-2010", indexed_endpoints_20101008}
+ { "Wrong assertionConsumer ordering on 08-10-2010", indexed_endpoints_20101008},
+ { "Warning when parsing AttributeValue node containing unknown namespace nodes", remove_warning_when_parssing_unknown_SNIPPET_LIST_NODES_20111007 }
};
Suite*