b059cec4f5
Change-Id: Id0f59e47ad1241aab802da11838e8ca8adb1543d
42 lines
1.1 KiB
Bash
Executable File
42 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "$#" -lt 1 ]; then
|
|
echo "Usage: .functests <flavour>"
|
|
echo "flavour = jenkins | dev"
|
|
exit 1
|
|
fi
|
|
|
|
FLAVOR="$1"
|
|
if [ "$FLAVOR" != "jenkins" ] && [ "$FLAVOR" != "dev" ]; then
|
|
echo "flavour must be either \"jenkins\" or \"dev\""
|
|
echo "dev flavor skips long running tests"
|
|
exit 1
|
|
fi
|
|
shift
|
|
|
|
ant build_storlets
|
|
|
|
SRC_DIR=$(python -c "import os; print os.path.dirname(os.path.realpath('$0'))")
|
|
cd ${SRC_DIR}/tests/functional
|
|
if [ "$FLAVOR" == "jenkins" ]; then
|
|
nosetests --exe -v $@
|
|
else
|
|
nosetests --exe -v -a '!slow' $@
|
|
fi
|
|
rvalue=$?
|
|
|
|
cd -
|
|
# dump log into VIRTUAL_ENV_DIR when this func test call via tox
|
|
if [ ! -z "${VIRTUAL_ENV+x}" ]; then
|
|
log_dir="${VIRTUAL_ENV}/logs"
|
|
mkdir -p ${log_dir}
|
|
for log_name in "account-server" "container-server" "object-server" "proxy-server" "ansible" "storlets-daemon" "daemon-factory"; do
|
|
log_file="${log_dir}/${log_name}.log"
|
|
echo "grep syslog from /var/log/syslog to ${log_file}"
|
|
sudo egrep "${log_name}" /var/log/syslog > ${log_file}
|
|
sudo chown ${USER}.${USER} ${log_file}
|
|
done
|
|
fi
|
|
|
|
exit $rvalue
|