blob: 1a4300213083dcd03d8ef7d599149877c51df231 [file] [log] [blame]
#!/usr/bin/env bash
# This script uses MESOS_SOURCE_DIR and MESOS_BUILD_DIR which come
# from configuration substitutions.
MESOS_SOURCE_DIR=@abs_top_srcdir@
MESOS_BUILD_DIR=@abs_top_builddir@
# Use colors for errors.
. ${MESOS_SOURCE_DIR}/support/colors.sh
# Force the use of the Python interpreter configured during building.
test ! -z "${PYTHON}" && \
echo "${RED}Ignoring PYTHON environment variable (using @PYTHON@)${NORMAL}"
PYTHON=@PYTHON@
DISTRIBUTE_EGG=${MESOS_BUILD_DIR}/3rdparty/distribute-0.6.26/dist/
DISTRIBUTE_EGG+=distribute-0.6.26@PYTHON_EGG_PUREPY_POSTFIX@.egg
test ! -e ${DISTRIBUTE_EGG} && \
echo "${RED}Failed to find ${DISTRIBUTE_EGG} verify PYTHONPATH${NORMAL}"
PROTOBUF=${MESOS_BUILD_DIR}/3rdparty/libprocess/3rdparty/protobuf-2.5.0
PROTOBUF_EGG=${PROTOBUF}/python/dist/
PROTOBUF_EGG+=protobuf-2.5.0@PYTHON_EGG_PUREPY_POSTFIX@.egg
test ! -e ${PROTOBUF_EGG} && \
echo "${RED}Failed to find ${PROTOBUF_EGG} check your PYTHONPATH ${NORMAL}"
MESOS_EGGS=""
for egg in interface native; do
base_dir="${MESOS_BUILD_DIR}/src/python/${egg}/dist/"
egg_path="${base_dir}mesos.${egg}-@PACKAGE_VERSION@"
if [[ ${egg} == "native" ]]; then
egg_path+="@PYTHON_EGG_POSTFIX@"
else
egg_path+="@PYTHON_EGG_PUREPY_POSTFIX@"
fi
egg_path+=".egg"
test ! -e ${egg_path} && \
echo "${RED}Failed to find ${egg_path}${NORMAL}" && \
exit 1
MESOS_EGGS+="${egg_path}:"
done
SCRIPT=${MESOS_SOURCE_DIR}/src/examples/python/test_framework.py
test ! -e ${SCRIPT} && \
echo "${RED}Failed to find ${SCRIPT}${NORMAL}" && \
exit 1
# Need to run in the directory containing this script so that the
# framework is able to find the executor.
cd `dirname ${0}`
PYTHONPATH="${DISTRIBUTE_EGG}:${PROTOBUF_EGG}:${MESOS_EGGS}" \
exec ${PYTHON} ${SCRIPT} "${@}"