I worked around this issue by giving the "other" group the same
permissions as for the owner and group for the folders that contain the
test, on the Linux machine. With this, I didn't have to sudo -u jenkins to
run the tests from the master. Also I had to include the export CLASSPATH
stuff in this test script as it couldn't source the .bashrc file.