Re: Tests needing user parameters

2005-10-19 Thread psema4
On 10/19/05, Mark Stosberg [EMAIL PROTECTED] wrote:
 On Wed, Oct 19, 2005 at 10:50:04PM +0100, Jess Robinson wrote:
   
I'm writing a module which will need user account data for it's tests, 
and
I'm wondering if there's a standard way (or module) for doing this..
  
   What do you mean by user account data?
  
   Perhaps UNIX/Linux UIDs and GIDs?
 
  Oops, sorry, thought it made sense ;)
 
  My module will login to a web service and manipulate data
  programmatically.. Nothing critical I assure you, just a tool ;) Since
  theres no dummy/test account that I know of, I'll need the users
  account/email address and password to login.

 Using an OO approach is one way to go:

 my $t = Test::Foo-new(\%my_params);

 $t-wobble_ok('zoop');

If you have administrative access (or mod_auth_mysql installed, along
with a mysql database), this method might work.  Similar solutions
might also be workable, depending on your setup and installed
packages.

I've been using mod_auth_mysql, Apache, and CGI.pm to handle this
situation (if I'm reading the question right) for a couple years now. 
A scheduled cron job runs every 30 minutes to copy the email users
encrypted passwords into the mysql tables if they've changed, adding
or removing user records as necessary to keep in sync with the email
accounts.  (Might be a hack but it works.)

After that, it's a relatively simple matter of setting up .htaccess
files (or http.conf) and adding to your scripts:

...
use CGI;
my $q = new CGI;
my $remote_user = $q-remote_user();
...

--
- SGE


Re: Tests needing user parameters

2005-10-19 Thread psema4
On 10/19/05, psema4 [EMAIL PROTECTED] wrote:
   My module will login to a web service and manipulate data
   programmatically.. Nothing critical I assure you, just a tool ;) Since
   theres no dummy/test account that I know of, I'll need the users
   account/email address and password to login.

n/m.  Sorry.  Think I misread the problem.   I'm really going to need
to Test::sleep soon.  :-)

--
- SGE