#!/bin/sh

# For 2.4.2+dfsg-1
GIT_COMMIT=3dd13d7fd890f662ac6c75344906ebe50524200e

set -e

echo "Downloading the upstream git repository..."
trap 'exit 77' EXIT  # skip the test if we fail while downloading data
cd ${AUTOPKGTEST_TMP:-/tmp}
wget -nv https://github.com/OSPG/binwalk/archive/${GIT_COMMIT}.tar.gz -O code.tar.gz
tar xf code.tar.gz
cd binwalk-*
trap '' EXIT

echo "Running the upstream tests"
cd testing/tests
mkdir -p /tmp/home
export HOME="/tmp/home"
pytest
