#!/usr/bin/perl #OK, let's extract essentials into XML # my $outcome; my $state = before; my %counts = ( 'failure' , 0, 'success', 0, 'violation', 0 ); print qq(\n\n); my $lines = 2; my $line = 0; while (<>) { while ( /(test label|start time):<\/td>(.+?)<\/td>/g ) { my $key = $1; my $val = $2; $key =~ s/(test |start )//; print qq($key$val\n); ++$line; } last if $line == $lines; } while (<>) { if ($state eq before) { /Gist/ or next; $state = running; } elsif ($state eq running) { if ( /.*?(success|failure|violation).*?([a-z].+?)\(/i ) { $outcome = $1; ++$counts{$outcome}; my $comment = &get_comment($3); print qq(<$outcome>\n); print qq( $2\n); print qq( $3\n); print qq($comment); print qq(\n); } elsif ( /.*?(success|failure|violation).*?([a-z].+)/i ) { $outcome = $1; ++$counts{$outcome}; print qq(<$outcome>\n); print qq( $2 ); $state = text; } elsif ( /

Test trace follows.<\/p>/ ) { $state = done; } } elsif ($state eq text) { if ( /(.*?)\(/i ) { my $comment = &get_comment($2); print qq($1\n); print qq( $2\n); print qq($comment); print qq(\n); $state = running; } elsif ( /(.*)/ ) { print $1, " "; } } elsif ($state eq done) { print qq(\n); map { print qq(<$_>$counts{$_}\n); } keys %counts; print qq(\n); print ("\n"); last; } } exit; sub get_comment { my $key = shift; $key =~ s/.*\/(.*)/$1/; my $class = $classes{$key}; return " -\n" unless $class; my $ret = ""; $ret = " " . $comments{$class} . "\n" if $comments{$class}; $class =~ /PR#(\d+)/ and $ret .= "$1\n" ; $ret = " -" if $ret eq ""; $ret .= " " . $links{$class} . "\n" if $links{$class}; return $ret; } BEGIN { %links = ( 'CVE-2008-2364' => 'http://bahumbug.wordpress.com/2008/12/03/cve-2008-2364/', ); %comments = ( 'addClen-POST-mulipart' => 'Bogus testcase' , 'bogus' => 'Bogus testcase' , 'clen17' => 'Looks like a bug - needs investigation' , 'failure' => 'Failed to run for a good reason' , 'warntime' => 'PR#16138 prevents test running' , 'pipeline' => 'Feature not supported' , 'wontfix' => 'WONTFIX contrived/irrelevant edge case' , 'chunkext' => "probable bug, edge-case, believed irrelevant", 'PR#43509' => 'testbench implementation of this case believed buggy', 'no retry' => 'Failed requests are returned to client, not retried by proxy', 'Fixed in svn r507526' => 'Fixed in svn r576514', 'traceenable' => 'Works with TraceEnable On', 'not our fault' => 'Protocol violation in the server is not the responsibility of the proxy, but we might nevertheless enable fixing it', 'CVE-2008-2364' => 'Not an issue - see CVE-2008-2364', ) ; %classes = ( 'addClen-POST-mulipart' => 'addClen-POST-mulipart' , 'date-accept-fmt-warn-asctime-rfc1123' => 'warntime', 'date-accept-fmt-warn-asctime-rfc850' => 'warntime', 'date-accept-fmt-warn-rfc850-rfc1123' => 'warntime', 'date-accept-fmt-warn-rfc850-asctime' => 'warntime', 'date-accept-fmt-warn-rfc1123-rfc850' => 'warntime', 'date-accept-fmt-warn-rfc1123-asctime' => 'warntime', 'datedWarn-all-0-0-1' => 'warntime', 'datedWarn-all-1-0-0' => 'warntime', 'datedWarn-all-1-1-1' => 'warntime', 'datedWarn-all-2-0-2' => 'warntime', 'datedWarn-all-spawn' => 'warntime', 'datedWarn-some-2-2-2' => 'PR#16138', 'datedWarn-some-0-1-1' => 'PR#16138', 'datedWarn-some-1-1-0' => 'PR#16138', 'datedWarn-some-multi' => 'PR#16138', 'datedWarn-some-spawn' => 'PR#16138', 'doNotAddHdr-Max-Forwards-GET-toSrv' => 'PR#16137', 'doNotAddHdr-Max-Forwards-OPTIONS-toSrv' => 'PR#16137', 'maxForwardsPstv-TRACE-012' => 'traceenable', 'maxForwardsPstv-TRACE-10' => 'traceenable', 'maxForwardsPstv-TRACE-1' => 'traceenable', 'maxForwardsPstv-TRACE-940' => 'traceenable', 'maxForwardsPstv-TRACE-absolute' => 'traceenable', 'maxForwardsPstv-TRACE-asterisk' => 'traceenable', 'maxForwardsPstv-TRACE-21-digit' => 'wontfix', 'maxForwardsPstv-OPTIONS-21-digit' => 'wontfix', 'maxForwardsZero-OPTIONS-asterisk' => 'bogus', 'maxForwardsZero-TRACE-asterisk' => 'bogus', 'maxForwardsZero-TRACE-absolute' => 'traceenable', 'methRetry-not-POST' => 'no retry' , 'methRetry-not-XTENSION' => 'no retry' , 'noXform-fwd-Content-Type-flat-17-withCc-toClt' => 'clen17' , 'noXform-fwd-Content-Type-flat-17-withCc-toSrv' => 'clen17' , 'noXform-fwd-Content-Type-flat-17-woutCc-toSrv' => 'clen17' , 'noXform-fwd-Content-Type-spawn-17-withCc-toClt' => 'clen17' , 'noXform-fwd-Content-Type-spawn-17-withCc-toSrv' => 'clen17' , 'noXform-fwd-Content-Type-spawn-17-woutCc-toSrv' => 'clen17' , 'appendHdr-Via-17-1-toClt' => 'PR#19439', 'appendHdr-Via-3-1-toClt' => 'PR#19439', 'appendHdr-Via-5-4-toClt' => 'PR#19439', 'chunked-1p0-longQValExt-16385-toClt' => 'chunkext', 'chunked-1p0-longValExt-16385-toClt' => 'chunkext', 'chunked-1p1-longQValExt-16385-toClt' => 'chunkext', 'chunked-1p1-longValExt-16385-toClt' => 'chunkext', 'chunked-1p1-longQValExt-16385-toSrv' => 'chunkext', 'chunked-1p1-longValExt-16385-toSrv' => 'chunkext', 'connRemoves-NxMv-toClt' => 'PR#43509', 'epilog-fwd-toClt' => 'not our fault', 'epilog-fwd-toSrv' => 'bogus', 'hopHdr-Keep-Alive-toClt' => 'PR#43455', 'hopHdr-Trailer-toClt' => 'PR#43455', 'hopHdr-Upgrade-toClt' => 'PR#43455', 'hopHdr-Proxy-Authenticate-toClt' => 'PR#43455', 'noXform-add-Content-Type-Content-Type-withCc-toClt' => 'PR#16139', 'optMethod-TRACE' => 'Fixed in svn r507526', # 'sc1xx-forward-17x100-4' => 'PR#16158', 'sc1xx-forward-1x100-0' => 'PR#16158', 'sc1xx-forward-1x100-4' => 'PR#16158', 'sc1xx-forward-1x101-4' => 'PR#16158', 'sc1xx-forward-1x199-4' => 'PR#16158', 'pipeRetry-long' => 'pipeline', 'pipeRetry-short' => 'pipeline', 'pipeOrder' => 'pipeline', 'sc1xx-accept-17x100-4' => 'CVE-2008-2364', 'sc1xx-forward-17x100-4' => 'CVE-2008-2364', 'sc1xx-drop-17x100-4' => 'CVE-2008-2364', ) ; }