Relax the test a bit more to handle different UIDs and GIDs.