I would like to automate integration tests of our OS X installer. The installer requires administrator authentication. Right now, we do manual testing (fire up a clean VM, download the installer, run it and check the installed product), but I would like to automate at least the initial testing of the installer. We use Jenkins for our CI server.
The Jenkins build slave could call
sudo installer -pkg <my package> -target /
but the Jenkins build slave (rightly) appears to run the build job as an unprivileged user.
How can I (1) run the installer via Jenkins or (2) verify the installer contents and functionality without running it?