#!/bin/sh -e
set -x

# Provide a simple minimal vanilla trytond.conf
# The testbed trytond.conf is already changed by the configuration
# of other binariess (e.g. tryton-server-postgresql)
TEST_CONF="$PWD"/trytond_autopkgtest.conf
# echo -e doesn't work in auotpkgtest
echo "[database]" > "$TEST_CONF"
echo "path = $PWD" >> "$TEST_CONF"
cd /usr/lib/python3/dist-packages/trytond
# Run as the tryton user to get a guaranteed writable db directory
# for the filestore tests
su tryton -s /bin/bash -c "TRYTOND_CONF="$TEST_CONF" DB_NAME=:memory: python3 -m unittest discover -s trytond.tests"
