summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/contrib/tts/config.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-05-18 14:04:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-29 11:59:46 +0100
commit225daf45a46aca31dfd21897ee302b32f671cd4b (patch)
tree76ab4e06c3239b7e04b332eaaed5da62fce5edc8 /bitbake/lib/toaster/contrib/tts/config.py
parent29143915ae543f3cd389a7b1e32967ab42730e45 (diff)
downloadpoky-225daf45a46aca31dfd21897ee302b32f671cd4b.tar.gz
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 <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/contrib/tts/config.py')
-rw-r--r--bitbake/lib/toaster/contrib/tts/config.py21
1 files changed, 21 insertions, 0 deletions
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 @@
22# everything that would be a global variable goes here 22# everything that would be a global variable goes here
23 23
24import os, sys, logging 24import os, sys, logging
25import socket
25 26
26LOGDIR = "log" 27LOGDIR = "log"
27SETTINGS_FILE = os.path.join(os.path.dirname(__file__), "settings.json") 28SETTINGS_FILE = os.path.join(os.path.dirname(__file__), "settings.json")
@@ -29,6 +30,26 @@ TEST_DIR_NAME = "tts_testdir"
29 30
30OWN_PID = os.getpid() 31OWN_PID = os.getpid()
31 32
33W3C_VALIDATOR = "http://icarus.local/w3c-validator/check?doctype=HTML5&uri="
34
35#TODO assign port dynamically
36TOASTER_PORT=56789
37
38#we parse the w3c URL to know where to connect
39
40import urlparse
41
42def get_public_ip():
43 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
44 p = urlparse.urlparse("http://icarus.local/w3c-validator/check?doctype=HTML5&uri=")
45 s.connect(( p.netloc, 80 if p.port is None else p.port))
46 hn = s.getsockname()[0]
47 s.close()
48 return hn
49
50TOASTER_BASEURL="http://%s:%d/" % (get_public_ip(), TOASTER_PORT)
51
52
32OWN_EMAIL_ADDRESS = "Toaster Testing Framework <alexandru.damian@intel.com>" 53OWN_EMAIL_ADDRESS = "Toaster Testing Framework <alexandru.damian@intel.com>"
33REPORT_EMAIL_ADDRESS = "alexandru.damian@intel.com" 54REPORT_EMAIL_ADDRESS = "alexandru.damian@intel.com"
34 55