Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm
Geoffrey Young wrote: you flipped the logic here. it needs to be unless -e $generated && -M $generated > -M $File::Find::name I don't think so. The two snippets you quoted above aren't the same. I've changed the functionality and changed the order of the arguments. ok, I see now. when I ran my own logic tests I flipped the files myself. confusing stuff :) Yes, -M is always confusing, since it reports the time since the last change. right now it reconfigures all the time: [warning] forcing re-configuration: [warning] - t/conf/extra.conf.in is newer than t/conf/extra.conf. -rw-rw-r--1 geoffgeoff1283 Feb 19 09:42 extra.conf -rw-rw-r--1 geoffgeoff 353 Feb 19 09:36 extra.conf.in I bet you see that problem when you do a full reconfigure, no? So, yes, there is a buglet in the comments, not the actual config process. Will fix that shortly. yes, you're right, it was the comments - extra.conf wasn't being regenerated every time, it was just the warning that was showing up. anyway, sorry for not paying more attention. No, no, your observation was good, as I indeed introduced a misleading commentary. I think it's all fixed now. __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm
>> you flipped the logic here. it needs to be >> >> unless -e $generated && -M $generated > -M $File::Find::name > > > I don't think so. The two snippets you quoted above aren't the same. > I've changed the functionality and changed the order of the arguments. ok, I see now. when I ran my own logic tests I flipped the files myself. confusing stuff :) >> right now it reconfigures all the time: >> >> [warning] forcing re-configuration: >> [warning] - t/conf/extra.conf.in is newer than t/conf/extra.conf. >> >> -rw-rw-r--1 geoffgeoff1283 Feb 19 09:42 extra.conf >> -rw-rw-r--1 geoffgeoff 353 Feb 19 09:36 extra.conf.in > > > I bet you see that problem when you do a full reconfigure, no? So, yes, > there is a buglet in the comments, not the actual config process. Will > fix that shortly. yes, you're right, it was the comments - extra.conf wasn't being regenerated every time, it was just the warning that was showing up. anyway, sorry for not paying more attention. --Geoff
Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm
Geoffrey Young wrote: +(my $generated = $File::Find::name) =~ s/\.in$//; +push @need_update, $generated +unless -e $generated && -M $generated < -M $File::Find::name; -if (my $extra_conf = $self->generate_extra_conf) { -for my $file (@$extra_conf) { -push @reasons, "$file.in is newer than $file" -if -e $file && -M "$file.in" < -M $file; -} you flipped the logic here. it needs to be unless -e $generated && -M $generated > -M $File::Find::name I don't think so. The two snippets you quoted above aren't the same. I've changed the functionality and changed the order of the arguments. The code: push @need_update, $generated unless -e $generated && -M $generated < -M $File::Find::name; says: a generated file needs to be updated, unless it already exists and it's younger than its source file. In other words, update the file if it doesn't exist or if it's older then the source file: push @need_update, $generated if (!-e $generated || -M $generated > -M $File::Find::name); Am I wrong? which is equivalent to if (! -e extra.conf || ! (extra.conf > extra.conf.in)) right now it reconfigures all the time: [warning] forcing re-configuration: [warning] - t/conf/extra.conf.in is newer than t/conf/extra.conf. -rw-rw-r--1 geoffgeoff1283 Feb 19 09:42 extra.conf -rw-rw-r--1 geoffgeoff 353 Feb 19 09:36 extra.conf.in I bet you see that problem when you do a full reconfigure, no? So, yes, there is a buglet in the comments, not the actual config process. Will fix that shortly. __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm
> +(my $generated = $File::Find::name) =~ s/\.in$//; > +push @need_update, $generated > +unless -e $generated && -M $generated < -M $File::Find::name; > -if (my $extra_conf = $self->generate_extra_conf) { > -for my $file (@$extra_conf) { > -push @reasons, "$file.in is newer than $file" > -if -e $file && -M "$file.in" < -M $file; > -} you flipped the logic here. it needs to be unless -e $generated && -M $generated > -M $File::Find::name which is equivalent to if (! -e extra.conf || ! (extra.conf > extra.conf.in)) right now it reconfigures all the time: [warning] forcing re-configuration: [warning] - t/conf/extra.conf.in is newer than t/conf/extra.conf. -rw-rw-r--1 geoffgeoff1283 Feb 19 09:42 extra.conf -rw-rw-r--1 geoffgeoff 353 Feb 19 09:36 extra.conf.in --Geoff
Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRun.pm TestSSLCA.pm
Stas Bekman wrote: [EMAIL PROTECTED] wrote: stas2004/02/09 10:07:49 Modified:perl-framework/Apache-Test/lib/Apache TestRun.pm TestSSLCA.pm Log: more t/ related fixes $self->{reconfigure} = $opts{configure} || (grep { $opts{$_}->[0] } qw(preamble postamble)) || (grep { $Apache::TestConfig::Usage{$_} } keys %conf_opts ) || - $self->passenv() || (! -e 'conf/httpd.conf'); + $self->passenv() || (! -e 't/conf/httpd.conf'); [...] -my $file = "conf/$name.cnf"; +my $file = "t/conf/$name.cnf"; we probably need to add a chdir_top call which used to be chdir_t, so that 'TEST' will work in addition to 't/TEST". chdir_top should make sure we are outside of 't'. I've added that functionality. __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::TestMM::generate_script vs. Win32 Paths
Randy Kobes wrote: On Wed, 18 Feb 2004, Stas Bekman wrote: Randy Kobes wrote: Thanks for testing, Randy +for my $key (keys %conf_opts) { +next unless Apache::TestConfig::conf_opt_is_a_filepath($key); +$conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key}); [ ... ] ay, that's so incredibly . there is no a core function that will take any given path and return a usable path? do you need to run this transform only if /\s/? What about long names (>8.3), don't they have short names too? Yes, they do have short names. And it is a pain ... I should have expanded - Win32::GetShortPathName() will return a usable path if the file/directory physically exists - if a conversion to 8.3 components is needed, then that is done, otherwise, the original is returned. However, at this stage I don't think (?) we can assume the file/directory yet exists, at least for all the ones that this is being applied to, so calling Win32::GetShortPathName on them will cause the given values to be lost if they don't yet exist. Why not? All these arguments should be existing. (I think sans -libmodperl which may not exist) So, actually, I take that back about applying Win32::GetSHortPathName($f) only if $f =~ /\s/, as that was a red herring - doing it like for my $key (keys %conf_opts) { next unless Apache::TestConfig::conf_opt_is_a_filepath($key); next unless -e $conf_opts{$key}; $conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key}); should be OK when the entry (physically) exists, whether that's a short or long name, and if it doesn't exist, presumably it will either be created or tested for later. One might have to do a Win32::GetShortPathName() if such an entry does get created later on, but we could wait and see. cool. In any case, please take the ownership of the patch I posted and once you guys are happy with it, please go ahead and commit it. Otherwise it's a broken phone. Thanks. For god's sake, can someone patch File::Spec to handle that win32 ridicule? Just think how much time every project wastes to deal with the same issues, again and again if they need to work with win32... not talking about making the source code cluttered with unneeded noise. that's just disgusting. Shouldn't canonfile() know how to deal with this GetShortPathName thingy? I guess it could, but that would involve somewhat of a departure from the philosophy of File::Spec. File::Spec can handle any combination of files/directories, whether or not they actually exist on the system, whereas things like Win32::GetShortPathName() only makes sense for files/directories that physically exist. So incorporating the short path name stuff in File::Spec would lead to a branch in what gets returned, depending on whether or not the entry physically exists. before you implement this ;) what would you expect canonfile to do under win32? is GetShortPathName is the thing you'd expect? As it will always work? BTW, does it make sure that two similar long names will never collapse into one short name? Meaning that the short name is not deterministic but depends on other the existence of other files with similar names? If it was deterministic, you could go and create the non-existing file, get its short name and delete the file, no? __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::TestMM::generate_script vs. Win32 Paths
On Wed, 18 Feb 2004, Stas Bekman wrote: > Randy Kobes wrote: > Thanks for testing, Randy > > >>+for my $key (keys %conf_opts) { > >>+next unless Apache::TestConfig::conf_opt_is_a_filepath($key); > >>+$conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key}); [ ... ] > > ay, that's so incredibly here>. there is no a core function that will take any > given path and return a usable path? > > do you need to run this transform only if /\s/? What about > long names (>8.3), don't they have short names too? Yes, they do have short names. And it is a pain ... I should have expanded - Win32::GetShortPathName() will return a usable path if the file/directory physically exists - if a conversion to 8.3 components is needed, then that is done, otherwise, the original is returned. However, at this stage I don't think (?) we can assume the file/directory yet exists, at least for all the ones that this is being applied to, so calling Win32::GetShortPathName on them will cause the given values to be lost if they don't yet exist. So, actually, I take that back about applying Win32::GetSHortPathName($f) only if $f =~ /\s/, as that was a red herring - doing it like for my $key (keys %conf_opts) { next unless Apache::TestConfig::conf_opt_is_a_filepath($key); next unless -e $conf_opts{$key}; $conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key}); should be OK when the entry (physically) exists, whether that's a short or long name, and if it doesn't exist, presumably it will either be created or tested for later. One might have to do a Win32::GetShortPathName() if such an entry does get created later on, but we could wait and see. > For god's sake, can someone patch File::Spec to handle > that win32 ridicule? Just think how much time every > project wastes to deal with the same issues, again and > again if they need to work with win32... not talking about > making the source code cluttered with unneeded noise. > that's just disgusting. > > Shouldn't canonfile() know how to deal with this > GetShortPathName thingy? I guess it could, but that would involve somewhat of a departure from the philosophy of File::Spec. File::Spec can handle any combination of files/directories, whether or not they actually exist on the system, whereas things like Win32::GetShortPathName() only makes sense for files/directories that physically exist. So incorporating the short path name stuff in File::Spec would lead to a branch in what gets returned, depending on whether or not the entry physically exists. > /of course none of these "flattering" comments are > directed at Randy and other brave and helpful folks ;)/ :) -- best regards, randy
[STATUS] (perl-framework) Wed Feb 18 23:46:43 EST 2004
httpd-test/perl-framework STATUS: -*-text-*- Last modified at [$Date: 2002/03/09 05:22:48 $] Stuff to do: * finish the t/TEST exit code issue (ORed with 0x2C if framework failed) * change existing tests that frob the DocumentRoot (e.g., t/modules/access.t) to *not* do that; instead, have Makefile.PL prepare appropriate subdirectory configs for them. Why? So t/TEST can be used to test a remote server. * problems with -d perl mode, doesn't work as documented Message-ID: <[EMAIL PROTECTED]> Date: Sat, 20 Oct 2001 12:58:33 +0800 Subject: Re: perldb Tests to be written: * t/apache - simulations of network failures (incomplete POST bodies, chunked and unchunked; missing POST bodies; slooow client connexions, such as taking 1 minute to send 1KiB; ...) * t/modules/autoindex - something seems possibly broken with inheritance on 2.0 * t/ssl - SSLPassPhraseDialog exec: - SSLRandomSeed exec:
[STATUS] (flood) Wed Feb 18 23:46:23 EST 2004
flood STATUS: -*-text-*- Last modified at [$Date: 2003/07/01 20:55:12 $] Release: 1.0: Released July 23, 2002 milestone-03: Tagged January 16, 2002 ASF-transfer: Released July 17, 2001 milestone-02: Tagged August 13, 2001 milestone-01: Tagged July 11, 2001 (tag lost during transfer) RELEASE SHOWSTOPPERS: * "Everything needs to work perfectly" Other bugs that need fixing: * I get a SIGBUS on Darwin with our examples/round-robin-ssl.xml config, on the second URL. I'm using OpenSSL 0.9.6c 21 dec 2001. * iPlanet sends "Content-length" - there is a hack in there now to recognize it. However, all HTTP headers need to be normalized before checking their values. This isn't easy to do. Grr. * OpenSSL 0.9.6 Segfaults under high load. Upgrade to OpenSSL 0.9.6b. Aaron says: I just found a big bug that might have been causing this all along (we weren't closing ssl sockets). How can I reproduce the problem you were seeing to verify if this was the fix? * SEGVs when /tmp/.rnd doesn't exist are bad. Make it configurable and at least bomb with a good error message. (See Doug's patch.) Status: This is fixed, no? * If APR has disabled threads, flood should as well. We might want to have an enable/disable parameter that does this also, providing an error if threads are desired but not available. * flood needs to clear pools more often. With a long running test it can chew up memory very quickly. We should just bite the bullet and create/destroy/clear pools for each level of our model: farm, farmer, profile, url/request-cycle, etc. * APR needs to have a unified interface for ephemeral port exhaustion, but aparently Solaris and Linux return different errors at the moment. Fix this in APR then take advantage of it in flood. * The examples/analyze-relative scripts fail when there are less than 5 unique URLs. Other features that need writing: * More analysis and graphing scripts are needed * Write robust tool (using tethereal perhaps) to take network dumps and convert them to flood's XML format. Status: Justin volunteers. Aaron had a script somewhere that is a start. Jacek is working on a Mozilla application, codename "Flood URL bag" (much like Live HTTP Headers) and small HTTP proxy. * Get chunked encoding support working. Status: Justin volunteers. He got sidetracked by the httpd implementation of input filtering and never finished this. This is a stopgap until apr-serf is completed. * Maybe we should make randfile and capath runtime directives that come out of the XML, instead of autoconf parameters. * We are using apr_os_thread_current() and getpid() in some places when what we really want is a GUID. The GUID will be used to correlate raw output data with each farmer. We may wish to print a unique ID for each of farm, farmer, profile, and url to help in postprocessing. * We are using strtol() in some places and strtoll() in others. Pick one (Aaron says strtol(), but he's not sure). * Validation of responses (known C-L, specific strings in response) Status: Justin volunteers * HTTP error codes (ie. teach it about 302s) Justin says: Yeah, this won't be with round_robin as implemented. Need a linked list-based profile where we can insert new URLs into the sequence. * Farmer (Single-thread, multiple profiles) Status: Aaron says: If you have threads, then any Farmer can be run as part of any Farm. If you don't have threads, you can currently only run one Farmer named "Joe" right now (this will be changed so that if you don't have threads, flood will attempt to run all Farmers in serial under one process). * Collective (Single-host, multiple farms) This is a number of Farms that have been fork()ed into child processes. * Megaconglomerate (Multiple hosts each running a collective) This is a number of Collectives running on a number of hosts, invoked via RSH/SSH or maybe even some proprietary mechanism. * Other types of urllists a) Random / Random-weighted b) Sequenced (useful with cookie propogation) c) Round-robin d) Chaining of the above strategies Status: Round-robin is complete. * Other types of reports Status: Aaron says: "simple" reports are functional. Justin added a new type that simply prints the approx. timestamp when the test was run, and the result as OK/FAIL; it is called "easy reports" (see flood_easy_reports.h). Fur
Re: port conflicts issue
Joe Orton wrote: On Wed, Feb 18, 2004 at 01:59:31PM -0800, Stas Bekman wrote: Joe Orton wrote: Has anyone else seen this? I regularly manage to get my httpd-test checkout into a state where the config suddenly has conflicting Listen statements (when it didn't on the previous ./t/TEST invocation): $ grep -r --include \*.conf Listen.*:8530 t/conf t/conf/ssl/ssl.conf:Listen 127.0.0.1:8530 t/conf/ssl/proxyssl.conf:Listen 127.0.0.1:8530 and the server won't start up. A -clean fixes it but it's kind of annoying... haven't managed to work out why. Yup. I saw that many times. It happes because of the inconsistency in what config files are reparsed. Every time config files are reparsed the ports are reassigned. If some files don't get regenerated they will still have the old port numbers. So what needs to be traced, is why 't/TEST -conf' doesn't pick up ssl config files. t/TEST -trace=debug -conf should be helpful. If you don't figure it out, I'll try to resolve that later. I haven't written the ssl part, so I'll need to first understand how does it work. Since it's not a part of the normal config. I didn't get anywhere tonight, but I worked out a repro case for the issue: ./t/TEST -clean ./t/TEST -start-httpd ./t/TEST -stop-httpd touch t/conf/ssl/* ./t/TEST -start-httpd Thanks a lot for the repro case and nudging me into fixing it, Joe. The current cvs should work fine. __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::TestMM::generate_script vs. Win32 Paths
Randy Kobes wrote: Thanks for testing, Randy +for my $key (keys %conf_opts) { +next unless Apache::TestConfig::conf_opt_is_a_filepath($key); +$conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key}); ^^^ I think if one calls Win32::GetShortPathName on something that has no short path name, then nothing is returned. For example, == use strict; use warnings; for ('C:\Program Files', 'C:\ProgramFiles') { my $x = Win32::GetShortPathName($_); if ($x) { print "$_ has a short name of $x\n"; } else { print "$_ has no short name\n"; } } === prints === C:\Program Files has a short name of C:\PROGRA~1 C:\ProgramFiles has no short name Thus, the above should probably include +for my $key (keys %conf_opts) { +next unless Apache::TestConfig::conf_opt_is_a_filepath($key); + + next unless $conf_opts{$key} =~ / /; +$conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key}); ay, that's so incredibly . there is no a core function that will take any given path and return a usable path? do you need to run this transform only if /\s/? What about long names (>8.3), don't they have short names too? For god's sake, can someone patch File::Spec to handle that win32 ridicule? Just think how much time every project wastes to deal with the same issues, again and again if they need to work with win32... not talking about making the source code cluttered with unneeded noise. that's just disgusting. Shouldn't canonfile() know how to deal with this GetShortPathName thingy? /of course none of these "flattering" comments are directed at Randy and other brave and helpful folks ;)/ __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::TestMM::generate_script vs. Win32 Paths
On Tue, 17 Feb 2004, Stas Bekman wrote: > Randy Kobes wrote: > > On Tue, 3 Feb 2004, Christopher H. Laco wrote: > > > > > >>I've installed Apache::Test 1.07 on ActiveState perl 5.6.1 > >>build 630 and am trying to make test scripts for a pile of > >>pages in a package I'm workin on. > >> > >>If I pass in an -httpd path that has spaces in the path, > >>it fails. > >> > >>use ExtUtils::MakeMaker; > >>use Apache::TestMM qw(test clean); > >> > >>push @ARGV, '-httpd', 'C:\Program Files\Apache Group\Apache\Apache.exe'; > > > > [ .. ] > > > >>Is this an Apache::Test problem, or possible an nmake issue? > > > > > > This case should be handled I'd think on the Apache::Test > > side. Does > >my $exe = 'C:\Program Files\Apache Group\Apache\Apache.exe'; > >$exe = Win32::GetShortPathName($exe); > >push @ARGV, '-httpd', $exe; > > work? If so, I'll look at seeing where this could be added > > within Apache::Test. > > This patch should probably take care of it. It's untested. Thanks, Stas - it looks good (applied manually, and informally tested, as I don't have Perl in a place with spaces in the directory name). A couple of comments below: > Index: lib/Apache/TestConfig.pm > === > RCS file: > /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v > retrieving revision 1.205 > diff -u -r1.205 TestConfig.pm > --- lib/Apache/TestConfig.pm 18 Feb 2004 00:30:57 - 1.205 > +++ lib/Apache/TestConfig.pm 18 Feb 2004 04:40:21 - > @@ -67,6 +67,16 @@ > (map { $_ . '_module_name', "$_ module name"} qw(cgi ssl thread access > auth)), > ); > > +my %filepath_conf_opts = map { $_ => 1 } > +qw(top_dir t_dir t_conf t_logs t_conf_file src_dir serverroot > + documentroot bindir sbindir httpd apxs httpd_conf perlpod sslca > + libmodperl); > + > +sub conf_opt_is_a_filepath { > +my $opt = shift; > +$opt && exists $filepath_conf_opts{$opt}; > +} > + > sub usage { > for my $hash (\%Usage) { > for (sort keys %$hash){ > Index: lib/Apache/TestRun.pm > === > RCS file: > /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v > retrieving revision 1.149 > diff -u -r1.149 TestRun.pm > --- lib/Apache/TestRun.pm 18 Feb 2004 04:09:08 - 1.149 > +++ lib/Apache/TestRun.pm 18 Feb 2004 04:40:21 - > @@ -238,6 +238,15 @@ > push @argv, $val; > } > > +# fixup the filepath options on win32 (spaces, short names, etc.) > +if (Apache::TestConfig::WIN32) { > +require Win32::GetShortPathName; The require isn't required, as Win32::GetShortPathName is a core function. > +for my $key (keys %conf_opts) { > +next unless Apache::TestConfig::conf_opt_is_a_filepath($key); > +$conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key}); ^^^ I think if one calls Win32::GetShortPathName on something that has no short path name, then nothing is returned. For example, == use strict; use warnings; for ('C:\Program Files', 'C:\ProgramFiles') { my $x = Win32::GetShortPathName($_); if ($x) { print "$_ has a short name of $x\n"; } else { print "$_ has no short name\n"; } } === prints === C:\Program Files has a short name of C:\PROGRA~1 C:\ProgramFiles has no short name Thus, the above should probably include > +for my $key (keys %conf_opts) { > +next unless Apache::TestConfig::conf_opt_is_a_filepath($key); > + + next unless $conf_opts{$key} =~ / /; > +$conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key}); -- best regards, randy