From 225daf45a46aca31dfd21897ee302b32f671cd4b Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Mon, 18 May 2015 14:04:53 +0100 Subject: bitbake: toaster tests: enable url check test Integrate the HTML5 validation as a test instead of calling a separate script. This enables us to get the HTML5 validation report as part of patch-level testing. gitignore the cache directory created by the http client (Bitbake rev: 931caab56301876cb8632b289835c2545a096ef6) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/lib/toaster/contrib/tts/config.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bitbake/lib/toaster/contrib/tts/config.py') diff --git a/bitbake/lib/toaster/contrib/tts/config.py b/bitbake/lib/toaster/contrib/tts/config.py index a4ea8cf5fa..c0e05369e6 100644 --- a/bitbake/lib/toaster/contrib/tts/config.py +++ b/bitbake/lib/toaster/contrib/tts/config.py @@ -22,6 +22,7 @@ # everything that would be a global variable goes here import os, sys, logging +import socket LOGDIR = "log" SETTINGS_FILE = os.path.join(os.path.dirname(__file__), "settings.json") @@ -29,6 +30,26 @@ TEST_DIR_NAME = "tts_testdir" OWN_PID = os.getpid() +W3C_VALIDATOR = "http://icarus.local/w3c-validator/check?doctype=HTML5&uri=" + +#TODO assign port dynamically +TOASTER_PORT=56789 + +#we parse the w3c URL to know where to connect + +import urlparse + +def get_public_ip(): + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + p = urlparse.urlparse("http://icarus.local/w3c-validator/check?doctype=HTML5&uri=") + s.connect(( p.netloc, 80 if p.port is None else p.port)) + hn = s.getsockname()[0] + s.close() + return hn + +TOASTER_BASEURL="http://%s:%d/" % (get_public_ip(), TOASTER_PORT) + + OWN_EMAIL_ADDRESS = "Toaster Testing Framework " REPORT_EMAIL_ADDRESS = "alexandru.damian@intel.com" -- cgit v1.2.3-54-g00ecf