Test coverage for 'check for redir'

Includes a minor refactor allowing variation of the result of the system
call per test