layerindex-web/docker/connectivity_check.sh
Paul Eggleton b5ba406a07 dockersetup.py: add connectivity check
It's easy to get the proxy settings wrong and not realise until you've
got quite a long way into the process of setting things up. Thus, add a
check where we actually try to fetch various things within the container
environment and fail reasonably early if things aren't working.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-10-02 14:13:47 +13:00

36 lines
675 B
Bash
Executable File

#!/bin/sh
# Run a few connectivity checks
echo "Checking external connectivity..."
CCTEMP=`mktemp -d`
cd $CCTEMP || exit 1
cleanup_tmp() {
cd /tmp
rm -rf $CCTEMP
}
HTTP_TEST_URL="http://example.com"
if ! wget -q $HTTP_TEST_URL ; then
echo "ERROR: failed to fetch $HTTP_TEST_URL"
cleanup_tmp
exit 1
fi
HTTPS_TEST_URL="https://google.com"
if ! wget -q $HTTPS_TEST_URL ; then
echo "ERROR: failed to fetch $HTTPS_TEST_URL"
cleanup_tmp
exit 1
fi
GIT_TEST_REPO="git://git.yoctoproject.org/meta-layerindex-test"
if ! git clone -q $GIT_TEST_REPO ; then
echo "ERROR: failed to clone $GIT_TEST_REPO"
cleanup_tmp
exit 1
fi
cleanup_tmp