#! /bin/sh
set -xe
origin="$PWD"

# Set up virtualenv
if [ -d tbc_l3_feature_venv ]; then
    rm -rf tbc_l3_feature_venv
fi

virtualenv -p python3.6 tbc_l3_feature_venv
. tbc_l3_feature_venv/bin/activate
python -m pip install -r firmware/validation/tbc_l3_feature/requirements.txt

# DBC files are generated by the make_dbcs fixture defined in the dbc_builder.py plugin.

# Run Smoke Test
python -m pytest firmware/validation/tbc_l3_feature/test_deploy.py \
                 --verbose

# Cleanup Bazel resources
bazel clean --expunge
