summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/contrib/tts/urlcheck.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-10-28 18:48:45 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-04 12:50:55 +0000
commit5bc6fa01e0581c703808597878244cf9a38cefba (patch)
treec4ead257ecf58e3937c3c354636466a7ebdbf163 /bitbake/lib/toaster/contrib/tts/urlcheck.py
parent953b2f50f003a53fc387edfdeb8aa96d904526b2 (diff)
downloadpoky-5bc6fa01e0581c703808597878244cf9a38cefba.tar.gz
bitbake: toaster: Remove contrib tts
Remove the "Toaster test system". We don't need a home brew test "framework" as the django test runner is more than adequate. None of these tests here are currently working and have been obsoleted by the work done on unit and browser tests in ./tests/. (Bitbake rev: 7a82e45ca5c4d470f62f83e72d00cbe45baa1537) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/contrib/tts/urlcheck.py')
-rw-r--r--bitbake/lib/toaster/contrib/tts/urlcheck.py53
1 files changed, 0 insertions, 53 deletions
diff --git a/bitbake/lib/toaster/contrib/tts/urlcheck.py b/bitbake/lib/toaster/contrib/tts/urlcheck.py
deleted file mode 100644
index 001fcee96a..0000000000
--- a/bitbake/lib/toaster/contrib/tts/urlcheck.py
+++ /dev/null
@@ -1,53 +0,0 @@
1from __future__ import print_function
2import sys
3
4import httplib2
5import config
6import urllist
7
8
9config.logger.info("Testing %s with %s", config.TOASTER_BASEURL, config.W3C_VALIDATOR)
10
11def validate_html5(url):
12 http_client = httplib2.Http(None)
13 status = "Failed"
14 errors = -1
15 warnings = -1
16
17 urlrequest = config.W3C_VALIDATOR+url
18
19 # pylint: disable=broad-except
20 # we disable the broad-except because we want to actually catch all possible exceptions
21 try:
22 resp, _ = http_client.request(urlrequest, "HEAD")
23 if resp['x-w3c-validator-status'] != "Abort":
24 status = resp['x-w3c-validator-status']
25 errors = int(resp['x-w3c-validator-errors'])
26 warnings = int(resp['x-w3c-validator-warnings'])
27
28 if status == 'Invalid':
29 config.logger.warning("Failed %s is %s\terrors %s warnings %s (check at %s)", url, status, errors, warnings, urlrequest)
30 else:
31 config.logger.debug("OK! %s", url)
32
33 except Exception as exc:
34 config.logger.warning("Failed validation call: %s", exc)
35 return (status, errors, warnings)
36
37
38def print_validation(url):
39 status, errors, warnings = validate_html5(url)
40 config.logger.error("url %s is %s\terrors %s warnings %s (check at %s)", url, status, errors, warnings, config.W3C_VALIDATOR+url)
41
42
43def main():
44 print("Testing %s with %s" % (config.TOASTER_BASEURL, config.W3C_VALIDATOR))
45
46 if len(sys.argv) > 1:
47 print_validation(sys.argv[1])
48 else:
49 for url in urllist.URLS:
50 print_validation(config.TOASTER_BASEURL+url)
51
52if __name__ == "__main__":
53 main()