I'm attempting to write some test code for the Win32::Security modules, and I'm beset by a conundrum.
To really test something that is designed to manipulate the security of files on the filesystem, one has to really do that. Otherwise, it's just smoke and mirrors and you don't know if the code really works.
I've flipped back and forth over this issue. Should I knowingly put code in a test suite that intentionally makes changes to the state of a system? I've started playing with such a test suite, and I've decided that if I decide to do this, the best approach is one like:
So, should I risk this? Is this a reasonable solution? How and where should I put appropriate warnings?
Thoughts?
In another vein, I'd like to write a test suite for some scripts I distribute with the modules (PermDump.pl, PermChg.pl, and PermFix.pl). I've placed these scripts in the lib/Win32/Security directory so that they will get packaged up and distributed by PPM packages (I hope), since they are very useful tools based upon this module.
What is the best way to locate those modules so that I can test them from a .t file? Scanning @INC for the files? How do I know what version of perl.exe to call (remember I'm running under Win32, and I'd like this module to work on any build since 5.005)?
Finally, I need another account to assign permissions to for the testing. Do you think I'm safe using Guest (since it's a BUILTIN and present on every machine)? What about localization issues? I think these accounts get different names under different localized versions of Win32. Aiiii!!!!
--Toby Ovod-Everett
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test code that makes filesystem modifications?
by Abigail-II (Bishop) on Mar 01, 2004 at 21:20 UTC | |
by tovod-everett (Sexton) on Mar 04, 2004 at 17:43 UTC | |
|
Re: Test code that makes filesystem modifications?
by adrianh (Chancellor) on Mar 01, 2004 at 22:49 UTC | |
|
Re: Test code that makes filesystem modifications?
by dragonchild (Archbishop) on Mar 02, 2004 at 02:22 UTC |