1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 12:49:46 +00: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:
Alexandru DAMIAN
2015-07-30 19:25:13 +03:00
committed by Richard Purdie
parent faaa5d45d8
commit ba667a0908
+8 -1
View File
@@ -2,11 +2,12 @@ from __future__ import print_function
import sys import sys
import httplib2 import httplib2
import config import config
import urllist import urllist
config.logger.info("Testing %s with %s", config.TOASTER_BASEURL, config.W3C_VALIDATOR)
def validate_html5(url): def validate_html5(url):
http_client = httplib2.Http(None) http_client = httplib2.Http(None)
status = "Failed" status = "Failed"
@@ -23,6 +24,12 @@ def validate_html5(url):
status = resp['x-w3c-validator-status'] status = resp['x-w3c-validator-status']
errors = int(resp['x-w3c-validator-errors']) errors = int(resp['x-w3c-validator-errors'])
warnings = int(resp['x-w3c-validator-warnings']) 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: except Exception as exc:
config.logger.warn("Failed validation call: %s", exc) config.logger.warn("Failed validation call: %s", exc)
return (status, errors, warnings) return (status, errors, warnings)