mirror of
https://git.yoctoproject.org/poky
synced 2026-04-17 00:32:13 +02:00
bitbake: toaster: tts: improve logging in urlcheck.py
This patch improves logging in the urlcheck.py. It allows properly running just HTML5 tests outside the test suite. (Bitbake rev: 91566d2ea8ca5a696ce742b9e5e3b7b6c10c200c) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
faaa5d45d8
commit
ba667a0908
@@ -2,11 +2,12 @@ from __future__ import print_function
|
||||
import sys
|
||||
|
||||
import httplib2
|
||||
|
||||
import config
|
||||
import urllist
|
||||
|
||||
|
||||
config.logger.info("Testing %s with %s", config.TOASTER_BASEURL, config.W3C_VALIDATOR)
|
||||
|
||||
def validate_html5(url):
|
||||
http_client = httplib2.Http(None)
|
||||
status = "Failed"
|
||||
@@ -23,6 +24,12 @@ def validate_html5(url):
|
||||
status = resp['x-w3c-validator-status']
|
||||
errors = int(resp['x-w3c-validator-errors'])
|
||||
warnings = int(resp['x-w3c-validator-warnings'])
|
||||
|
||||
if status == 'Invalid':
|
||||
config.logger.warn("Failed %s is %s\terrors %s warnings %s (check at %s)", url, status, errors, warnings, urlrequest)
|
||||
else:
|
||||
config.logger.debug("OK! %s", url)
|
||||
|
||||
except Exception as exc:
|
||||
config.logger.warn("Failed validation call: %s", exc)
|
||||
return (status, errors, warnings)
|
||||
|
||||
Reference in New Issue
Block a user