unit-test: Support running as non-root
This is nice to have so that all of the generated files in our workspace
are owned by our user so we don't have to deal with ownership issues
after the build has completed.
Tested:
Built all of the openbmc packages locally and found no regressions.
Change-Id: I0811ac4e356a023a1238e291f8184dfe01eb003e
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/run-unit-test-docker.sh b/run-unit-test-docker.sh
index 5a4427c..8475556 100755
--- a/run-unit-test-docker.sh
+++ b/run-unit-test-docker.sh
@@ -72,6 +72,7 @@
docker run --cap-add=sys_admin --rm=true \
--network host \
--privileged=true \
+ -u "$USER" \
-w "${DOCKER_WORKDIR}" -v "${WORKSPACE}":"${DOCKER_WORKDIR}" \
-e "MAKEFLAGS=${MAKEFLAGS}" \
-t ${DOCKER_IMG_NAME} \