Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

drhyde (1683)

  (email not shown publicly)

Journal of drhyde (1683)

Wednesday July 23, 2003
05:15 AM

More on FFR::Permissions

[ #13636 ]
If anyone has any suggestions for sane ways of thoroughly testing this module, please let me know. Unfortunately, a complete test suite would need to be able to change its EUID and consequently would need to be run as root. And to make matters worse, many machines won't have sufficiently complex user/group relationships *and* even the default usernames and group names aren't particularly predictable across platforms. Right now, the only test is that it loads and compiles, and users just have to trust me that I have tested the functionality myself.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • If it were me I'd mock everything that talks to the system:

    • I'd mock getpwent() and getgrent() so I could have known UID/group mappings.
    • I'd mock stat() so I could get known results rather than muck around creating a bunch of files with specific permissions.
    • I'd wrap all acccess to $> within a subroutine so I could override it to give known results during testing.