From 8ed61f3f3cb5fd898c1ee7563bdb4a31ca715d20 Mon Sep 17 00:00:00 2001 From: Björn Mattsson Date: Wed, 7 Nov 2018 13:42:16 +0100 Subject: Fixat till nya tester i Makefilen --- Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7fd8e546..a222111e 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ TOU := swamid-tou-en.txt swamid-tou-sv.txt all: clean dependencies test sign clean web MXML=$(shell echo *.mxml) +SWAMIDXML=$(patsubst swamid-2.0/%.xml,.time/%.time,$(wildcard swamid-2.0/*.xml)) sign: swamid upstream projects @@ -242,6 +243,30 @@ testAttributeInIdP: test: syntaxtest testMDUI testOrgData testEntCat testSimpleSign testALlevel testEduGAINchecks testRefedsRnS testGeantCoCo testMetadataUsage testBadStrings testIdPinSP testRoleDescriptor testAttributeInIdP testValidContact +test2: $(SWAMIDXML) + +.time/%.time: swamid-2.0/%.xml + @#testMDUI testOrgData testEntCat testSimpleSign testALlevel testEduGAINchecks testRefedsRnS testGeantCoCo testMetadataUsage testBadStrings testIdPinSP testRoleDescriptor testAttributeInIdP testValidContact + @xmllint --xinclude --nowarning --noout --path schema --schema schema.xsd $< 2>&1 + @cat $< | sed -n 's/.*xml:lang="\([^"]*\)".*/\1/p' | sort -u | grep -vxE 'cs|da|de|en|fi|fr|it|sv' | sed 's/.*/Bad lang code : &/' | grep . && exit 1 || true + @if ( grep -q IDPSSODescriptor $< ) ; then \ + echo "Do IdP checks" ; \ + for lang in `cat $< | sed -n 's/.*xml:lang="\(..\)".*/\1/p' | sort -u` ; do \ + mdui_displayname=`cat $< | sed 's;\(/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g'` organizationdisplayname=`cat $< | sed 's;\(/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g'` ; if [ -n "$$mdui_displayname" -a -n "$$organizationdisplayname" -a "$$mdui_displayname" != "$$organizationdisplayname" ] ; then echo "Missmatch for lang = $$lang\nDisplayName = '$$mdui_displayname' but OrganizationDisplayName = '$$organizationdisplayname'" | sed 's/.*/&/'; fi | grep . && exit 1 || true ;\ + for x in `find $(SRCDIRS) -name \*.xml | xargs grep -l IDPSSODescriptor | egrep -v $<` ; do cat $$x | sed 's;\(/dev/null | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g' | egrep "^$$mdui_displayname$$" | sed "s;^;Duplicate DisplayName in $$x for lang = $$lang\n;" | sed 's/.*/&/' ; done | grep . && exit 1 || true;\ + done \ + fi +# | sed 's/^[ ]*//;s/[ ]*$$//' ; done\ +#| tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g' + @#echo "Checking for invalid IPHint" + @#for x in `find $(SRCDIRS) -name \*.xml`; do if cat $$x | sed -n 's;.*<[a-z0-9:]*IPHint>\(.*\);\1;p' | grep -q -vE '^$$|^[0-9./a-fA-F:]*$$' ; then echo " $$x" | sed 's/.*/&/' ; fi ; done + @#echo "Checking for invalid geodata (syntax is geo:xx.yy,zz.vv)" + @#for x in `find $(SRCDIRS) -name \*.xml`; do if cat $$x | sed -n 's;.*<[a-z0-9:]*GeolocationHint>\(.*\);\1;p' | grep -q -vE '^$$|^geo:[0-9][0-9][0-9.]*,[0-9][0-9][0-9.]*$$' ; then echo " $$x" | sed 's/.*/&/' ; fi ; done + @#echo "Check for IdP:s with Logos over http" + @#for x in `find $(SRCDIRS) -name \*.xml`; do if cat $$x | sed -n '/IDPSSODescriptor/,/\/IDPSSODescriptor/p' | grep -q 'Logo .*http://' ; then echo " $$x" | sed 's/.*/&/' ; fi ; done + + @touch -r $< $@ + deeptest: test testMDUIreach commit: tidy test -- cgit v1.2.3