diff options
author | Björn Mattsson <bjorn@sunet.se> | 2021-12-13 13:53:11 +0100 |
---|---|---|
committer | Björn Mattsson <bjorn@sunet.se> | 2021-12-13 13:53:11 +0100 |
commit | 0b0f547852c566d0f10893911cb74cebff337ddc (patch) | |
tree | 975aecc21ead125a2cdb56e96d573d38e5687c68 | |
parent | ed8db14ea805a29ec5e19ea10e2fc57758ede694 (diff) |
Added checks for multiple EntityAttributes
-rw-r--r-- | Makefile | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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/.*/\ \ [1;31m&[0m/' ; 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/.*/[1;31m&[0m/'; 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/.*/[1;31m&[0m/' ; 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/.*/[1;31mBad lang code : &[0m/' | grep . && exit 1 || true + @if [ `grep EntityAttributes $< | wc -l ` -gt 2 ]; then echo "Multiple EntityAttributes" | sed 's/.*/[1;31m&[0m/' ; exit 1; fi @if ( grep -q IDPSSODescriptor $< ) ; then \ echo "Do IdP checks" ; \ echo ">Checking for uniq IdP MDUI DisplayName"; \ |