diff options
author | Björn Mattsson <Bjorn@bjorn-helena.se> | 2020-11-26 17:02:24 +0100 |
---|---|---|
committer | Björn Mattsson <Bjorn@bjorn-helena.se> | 2020-11-26 17:02:24 +0100 |
commit | 8d1f303c04f04019abcbfe26dbdb2bb883a5e962 (patch) | |
tree | 3ebd0cefbf17aea0f67b83823b94858ab8ddc4d8 | |
parent | d8ec65b8e8f80e963817fc4fa4fa7334df94c234 (diff) |
Updated tests in test2
-rw-r--r-- | Makefile | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -266,7 +266,8 @@ testRegistrationAuthority: #test: syntaxtest testMDUI testOrgData testEntCat testSimpleSign testALlevel testEduGAINchecks testRefedsRnS testGeantCoCo testMetadataUsage testBadStrings testIdPinSP testRoleDescriptor testAttributeInIdP testValidContact testRegistrationAuthority test: syntaxtest testMDUI testEntCat testSimpleSign testALlevel testEduGAINchecks testRefedsRnS testGeantCoCo testMetadataUsage testBadStrings testIdPinSP testRoleDescriptor testAttributeInIdP testValidContact testRegistrationAuthority -test2: $(SWAMIDXML) schematest testMDUI testEntCat testSimpleSign testALlevel testEduGAINchecks testRefedsRnS testGeantCoCo testMetadataUsage testBadStrings testIdPinSP testRoleDescriptor testAttributeInIdP testValidContact testRegistrationAuthority +test2: $(SWAMIDXML) schematest testEntCat testSimpleSign testALlevel testEduGAINchecks testRefedsRnS testGeantCoCo testMetadataUsage testBadStrings testIdPinSP testRoleDescriptor testAttributeInIdP testValidContact testRegistrationAuthority +#test2: $(SWAMIDXML) .time/%.time: swamid-2.0/%.xml @# make schematest @@ -277,27 +278,26 @@ test2: $(SWAMIDXML) schematest testMDUI testEntCat testSimpleSign testALlevel te @xsltproc xslt/clean-entitydescriptor.xsl $< > $<.c && mv $<.c $< @# make testMDUI + @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 -q IDPSSODescriptor $< ) ; then \ echo "Do IdP checks" ; \ + echo ">Checking for uniq IdP MDUI DisplayName"; \ 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'` ;\ 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/.*/[1;31m&[0m/' ; done | grep . && exit 1 || true;\ - done \ + done; \ + echo ">Checking for invalid IPHint"; \ + cat $< | sed -n 's;.*<[a-z0-9:]*IPHint>\(.*\)</[a-z0-9:]*IPHint>;\1;p' | grep -vE '^$$|^[0-9./a-fA-F:]*$$' | sed 's/.*/[1;31m&[0m/'; \ + echo ">Checking for invalid geodata (syntax is geo:xx.yy,zz.vv)";\ + cat $< | sed -n 's;.*<[a-z0-9:]*GeolocationHint>\(.*\)</[a-z0-9:]*GeolocationHint>;\1;p' | grep -vE '^$$|^geo:[0-9][0-9][0-9.]*,[0-9][0-9][0-9.]*$$' | sed 's/.*/[1;31m&[0m/' ; \ + echo ">Check for IdP:s with Logos over http";\ + cat $< | grep 'Logo .*http://' | sed 's/.*>\(.*\)<.*/[1;31m\1[0m/' | grep . && exit 1 || exit 0 ; \ 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/.*/[1;31m&[0m/' ; 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/.*/[1;31m&[0m/' ; 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/.*/[1;31m&[0m/' ; fi ; done @echo $< done - @touch -r $< $@ deeptest: test testMDUIreach |