aboutsummaryrefslogtreecommitdiffstats
path: root/docker/connectivity_check.sh
blob: 59b26b89adecd47e99b296dd05c56b1d3828b077 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/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