summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Mattsson <bjorn@sunet.se>2021-12-13 13:53:11 +0100
committerBjörn Mattsson <bjorn@sunet.se>2021-12-13 13:53:11 +0100
commit0b0f547852c566d0f10893911cb74cebff337ddc (patch)
tree975aecc21ead125a2cdb56e96d573d38e5687c68
parented8db14ea805a29ec5e19ea10e2fc57758ede694 (diff)
Added checks for multiple EntityAttributes
-rw-r--r--Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 72d23d16..b3c7755a 100644
--- a/Makefile
+++ b/Makefile
@@ -221,6 +221,8 @@ testOrgData:
@for lang in `cat swamid-2.0/*.xml | sed -n 's/.*xml:lang="\(..\)".*/\1/p' | sort -u` ; do for x in `find $(SRCDIRS) -name \*.xml | xargs grep -l IDPSSODescriptor` ; do cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/Organization/OrganizationDisplayName[@xml:lang='$$lang']" - 2>/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)</[^>]*>;\1\n;g' | sed "s;^;$$x $$lang ;" | sed 's/.*/\ \ &/' ; done | sort -k 3 | uniq -d -f 2 ; done | grep . && exit 1 || true
testEntCat:
+ @echo "Checking for multiple EntityAttributes in EntityDescriptor/Extensions"
+ @for x in `find $(SRCDIRS) -name \*.xml | xargs grep -l EntityAttributes` ; do if [ `grep EntityAttributes $$x | wc -l ` -gt 2 ]; then echo "Multiple EntityAttributes in $$x" | sed 's/.*/&/'; fi ; done | grep . && exit 1 || true
@echo "Checking for entity-categories in SPSSODescriptors that should be moved to EntityDescriptor/Extensions"
@for x in `find $(SRCDIRS) -name \*.xml`; do if cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath /EntityDescriptor/SPSSODescriptor/Extensions/EntityAttributes - 2>/dev/null | grep -q entity-category ; then echo " $$x" | sed 's/.*/&/' ; fi ; done | grep . && exit 1 || true
@echo "Checking for entity-categories in IDPSSODescriptor that should be moved to EntityDescriptor/Extensions"
@@ -300,6 +302,7 @@ test2: $(SWAMIDXML) schematest testEntCat testALlevel testEduGAINchecks testRefe
@echo "Checking for bad lang codes"
@# Lang = ISO_639-1
@cat $< | sed -n 's/.*xml:lang="\([^"]*\)".*/\1/p' | sort -u | grep -vxE 'cs|da|de|en|fi|fr|it|sv|no|nn|nb|is' | sed 's/.*/Bad lang code : &/' | grep . && exit 1 || true
+ @if [ `grep EntityAttributes $< | wc -l ` -gt 2 ]; then echo "Multiple EntityAttributes" | sed 's/.*/&/' ; exit 1; fi
@if ( grep -q IDPSSODescriptor $< ) ; then \
echo "Do IdP checks" ; \
echo ">Checking for uniq IdP MDUI DisplayName"; \