#!/bin/sh

# This testsuite is part of autopkgtest
# autopkgtest is a tool for testing Debian binary packages
#
# autopkgtest is Copyright (C) 2006-2013 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>

set -e
testdir="$(dirname "$(readlink -f "$0")")"
rootdir="$(dirname "$testdir")"

if ! type pyflakes3 >/dev/null 2>&1; then
    echo "pyflakes3 not available, skipping"
    exit 0
fi

pyflakes3 \
    "$rootdir/lib" \
    "$rootdir/runner/autopkgtest" \
    "$testdir/autopkgtest" \
    "$testdir/autopkgtest_args" \
    "$testdir/qemu" \
    "$testdir/testdesc" \
    "$testdir"/*.py \
    "$rootdir/tools/autopkgtest-build-docker" \
    "$rootdir/tools/autopkgtest-build-qemu" \
    "$rootdir/tools/autopkgtest-buildvm-ubuntu-cloud"

for v in chroot docker null schroot lxc lxd qemu ssh unshare; do
    pyflakes3 "$rootdir/virt/autopkgtest-virt-$v"
done
