Getgroups output will change depending on the environment and setgroups requires root so they are hard to test.