in reply to 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.