summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Mattsson <Bjorn.Mattsson@bth.se>2018-11-07 13:42:16 +0100
committerBjörn Mattsson <Bjorn.Mattsson@bth.se>2018-11-07 13:42:16 +0100
commit8ed61f3f3cb5fd898c1ee7563bdb4a31ca715d20 (patch)
tree22f7deb8de9a6e860b35bcd45b24464deae47b34
parentddf6a827e30158c0ca7403b35b9333bbf4080467 (diff)
Fixat till nya tester i Makefilen
-rw-r--r--.gitignore1
-rw-r--r--Makefile25
2 files changed, 26 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 04dfd9ab..80a54c4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@ swamid-externals-1.0*
swamid-externals-2.0*
swamid-interfederations-1.0*
swamid-interfederations-2.0*
+.time/*
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;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/IDPSSODescriptor/Extensions/UIInfo/DisplayName[@xml:lang='$$lang']" - 2>/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)</[^>]*>;\1\n;g'` organizationdisplayname=`cat $< | 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'` ; 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;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/IDPSSODescriptor/Extensions/UIInfo/DisplayName[@xml:lang='$$lang']" - 2>/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>\(.*\)</[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>\(.*\)</[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