in reply to Re: mocking or trapping system calls
in thread mocking or trapping system calls

...but that won't help if the "commands are either executable only by the root-user and/or do things you'd rather not do in a test" — as desired by the OP.