bigmacbear has asked for the wisdom of the Perl Monks concerning the following question:
I am in the midst of refactoring a large application into several modules, on the theory that it will make it easier to package the application for use in different places if it is modularized.
One of the modules provides a frontend to Net::Telnet::Cisco to slurp up various tables from routers and switches. To do so it must log in to each router or switch using its telnet and enable passwords.
My question is: given the fact that it is problematic to do anything that prompts the user in a t/*.t script, and it is even more problematic to ask for the user to put passwords on the command line or in the environment (which in "make test" is often done from the command line anyway), how can I test these modules at all?
Net::Telnet::Cisco itself seems to get around the issue by using only a test.pl script (which doesn't have the same issues as a t/*.t script WRT the test harness eating the prompt). Can a given module use *both* test.pl and t/*.t?
As you can probably tell, I'm new to the Monastery and fairly new at writing modules as opposed to scripts. Any assistance will be appreciated. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Module testing using passwords
by adrianh (Chancellor) on Mar 06, 2004 at 00:10 UTC | |
by bigmacbear (Monk) on Mar 08, 2004 at 16:59 UTC | |
by adrianh (Chancellor) on Mar 09, 2004 at 11:26 UTC | |
|
Re: Module testing using passwords
by tachyon (Chancellor) on Mar 05, 2004 at 23:46 UTC | |
by adrianh (Chancellor) on Mar 06, 2004 at 00:27 UTC |