Changeset 14871 in josm
- Timestamp:
- 2019-03-10T14:41:48+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/TestHTTPS.pl
r14626 r14871 8 8 9 9 my %urls; 10 my %known; 10 11 11 my %known = map {$_ => 1} qw( 12 siglon.londrina.pr.gov.br 13 tiles.itoworld.com 14 tms.cadastre.openstreetmap.fr 15 www.jgoodies.com 16 zibi.openstreetmap.org.pl 17 ); 12 sub getignores 13 { 14 open FILE,"<:encoding(utf-8)","josm_httpsignores.txt" or die; 15 for my $line (<FILE>) 16 { 17 if($line =~ /\|\| TestHTTPS \|\| \{\{\{(.*)\}\}\} \|\|/) 18 { 19 $known{$1}++; 20 } 21 } 22 close FILE; 23 } 18 24 19 25 sub getmaps … … 84 90 } 85 91 86 print "Options: \n PLUGIN STYLE RULE PRESET MAP DUMP\n GETPLUGIN GETSTYLE GETRULE GETPRESET GETMAP GETDUMP\n LOCAL\n ALL GETALL\n" if !@ARGV;92 print "Options: \n PLUGIN STYLE RULE PRESET MAP DUMP\n GETPLUGIN GETSTYLE GETRULE GETPRESET GETMAP GETDUMP\n LOCAL\n IGNORES GETIGNORES\n ALL GETALL\n" if !@ARGV; 87 93 88 94 open OUTFILE,">","josm_https.txt" or die "Could not open output file"; … … 90 96 sub doprint($) 91 97 { 92 print OUTFILE $_[0]; 93 print $_[0]; 98 my $t = $_[0]; 99 for my $k (sort keys %known) 100 { 101 $t =~ s/(\Q$k\E)/~~$1~~/g; 102 } 103 print OUTFILE $t; 104 print $t; 94 105 } 95 106 … … 97 108 for my $ARG (@ARGV) 98 109 { 99 if($ARG eq "ALL") {push(@ARGV, "PLUGIN", "STYLE", "RULE", "PRESET", "MAP", "DUMP" );}100 if($ARG eq "GETALL") {push(@ARGV, "GETPLUGIN", "GETSTYLE", "GETRULE", "GETPRESET", "GETMAP", "GETDUMP" );}110 if($ARG eq "ALL") {push(@ARGV, "PLUGIN", "STYLE", "RULE", "PRESET", "MAP", "DUMP", "IGNORES");} 111 if($ARG eq "GETALL") {push(@ARGV, "GETPLUGIN", "GETSTYLE", "GETRULE", "GETPRESET", "GETMAP", "GETDUMP", "GETIGNORES");} 101 112 } 102 113 my %ARGS = map {$_ => 1} @ARGV; # prevent double arguments by passing through a hash 103 114 for my $ARG (sort keys %ARGS) 104 115 { 116 if($ARG eq "GETIGNORES") { system "curl https://josm.openstreetmap.de/wiki/IntegrationTestIgnores?format=txt -o josm_httpsignores.txt"; getignores();} 117 if($ARG eq "IGNORES") { getignores(); } 105 118 if($ARG eq "LOCAL") {$local = 1; } 106 119 if($ARG eq "GETDUMP") { system "scp josm\@josm.openstreetmap.de:auto/httpinfo.dump josm_dump.txt"; getdump();} … … 123 136 if($local) # skip test 124 137 { 125 doprint "* ".($known{$url} ? "~~" : "")."$url:$i\n";138 doprint "* $url:$i\n"; 126 139 next; 127 140 } … … 135 148 my($code, $mess, %h) = $s->read_response_headers; 136 149 alarm(0); 137 doprint "* ".($known{$url} ? "~~" : "")."$url [$code $mess]: $i\n";150 doprint "* $url [$code $mess]: $i\n"; 138 151 }; 139 152 if($@ && $@ !~ "(--Alarm--|Connection refused)") … … 142 155 $e =~ s/[\r\n]//g; 143 156 $e =~ s/ at scripts\/TestHTTPS.pl .*//; 144 doprint "* ".($known{$url} ? "~~" : "")."$url [Error $e] :$i\n";157 doprint "* $url [Error $e] :$i\n"; 145 158 } 146 159 }
Note:
See TracChangeset
for help on using the changeset viewer.