'Runs a wget command with a 30s timeout
This checks that the repository is reachable, and avoids the need to
wait for a full 10min timeout.'

def _quick_http_test(self):

    mktemp = 'mktemp    -u    /tmp/tmp.XXXXXX'
    dest_file_path = self.run_command(mktemp).stdout.strip()
    try:
        http_cmd = (self.wget_cmd_pattern % (self.url, dest_file_path))
        try:
            self.run_command(http_cmd, _run_command_dargs={'timeout': 30})
        except Exception as e:
            msg = 'HTTP    test    failed,    unable    to    contact    %s:    %s'
            raise error.PackageFetchError((msg % (self.url, e)))
    finally:
        self.run_command(('rm    -rf    %s' % dest_file_path))
