Lines Matching +full:pre +full:- +full:processing
1 #!/bin/bash -xe
6 # and test the input UNIT_TEST_PKG. The docker container will be pre-populated
7 # with the most used OpenBMC repositories (phosphor-dbus-interfaces, sdbusplus,
8 # phosphor-logging, ...). This allows the use of docker caching
11 # docker container will be pre-populated with the latest code from that input
23 # `/usr/share/dbus-1/system.conf`
25 # NO_FORMAT_CODE: Optional, do not run format-code.sh
27 # EXTRA_UNIT_TEST_ARGS: Optional, pass arguments to unit-test.py
28 # INTERACTIVE: Optional, run a bash shell instead of unit-test.py
31 # Trace bash processing. Set -e so when a step fails, we fail the build
32 set -uo pipefail
35 BRANCH=${BRANCH:-"master"}
36 DOCKER_WORKDIR="${DOCKER_WORKDIR:-$WORKSPACE}"
37 OBMC_BUILD_SCRIPTS="openbmc-build-scripts"
39 UNIT_TEST_PY="unit-test.py"
40 DBUS_UNIT_TEST_PY="dbus-unit-test.py"
41 TEST_ONLY="${TEST_ONLY:-}"
42 DBUS_SYS_CONFIG_FILE=${dbus_sys_config_file:-"/usr/share/dbus-1/system.conf"}
43 MAKEFLAGS="${MAKEFLAGS:-""}"
44 NO_FORMAT_CODE="${NO_FORMAT_CODE:-}"
45 INTERACTIVE="${INTERACTIVE:-}"
46 http_proxy=${http_proxy:-}
52 if [ ! -d "${WORKSPACE}" ]; then
56 if [ ! -d "${WORKSPACE}/${OBMC_BUILD_SCRIPTS}" ]; then
61 if [ ! -d "${WORKSPACE}/${UNIT_TEST_PKG}" ]; then
68 echo "Building docker image with build-unit-test-docker"
71 DOCKER_IMG_NAME=$(./scripts/build-unit-test-docker)
74 # Allow the user to pass options through to unit-test.py:
75 # EXTRA_UNIT_TEST_ARGS="-r 100" ...
82 UNIT_TEST="${UNIT_TEST_SCRIPT_DIR}/${UNIT_TEST_PY},-w,${DOCKER_WORKDIR},\
83 -p,${UNIT_TEST_PKG},-b,$BRANCH,-v${TEST_ONLY:+,-t}${NO_FORMAT_CODE:+,-n}\
92 if [ -n "${http_proxy}" ]; then
94 --env HTTP_PROXY=${http_proxy} \
95 --env HTTPS_PROXY=${http_proxy} \
96 --env FTP_PROXY=${http_proxy} \
97 --env http_proxy=${http_proxy} \
98 --env https_proxy=${http_proxy} \
99 --env ftp_proxy=${http_proxy}"
103 # the env to allow the home mount to work (no impact on non-podman systems)
104 export PODMAN_USERNS="keep-id"
108 docker run --cap-add=sys_admin --rm=true \
109 --privileged=true \
111 -u "$USER" \
112 -w "${DOCKER_WORKDIR}" -v "${WORKSPACE}":"${DOCKER_WORKDIR}" \
113 -e "MAKEFLAGS=${MAKEFLAGS}" \
114 ${EXTRA_DOCKER_RUN_ARGS:-} \
115 -${INTERACTIVE:+i}t "${DOCKER_IMG_NAME}" \
116 "${UNIT_TEST_SCRIPT_DIR}/${DBUS_UNIT_TEST_PY}" -u "${UNIT_TEST}" \
117 -f "${DBUS_SYS_CONFIG_FILE}"