diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-05-18 14:04:53 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-29 11:59:46 +0100 |
commit | 225daf45a46aca31dfd21897ee302b32f671cd4b (patch) | |
tree | 76ab4e06c3239b7e04b332eaaed5da62fce5edc8 /bitbake/lib/toaster/contrib/tts/config.py | |
parent | 29143915ae543f3cd389a7b1e32967ab42730e45 (diff) | |
download | poky-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.py | 21 |
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 | ||
24 | import os, sys, logging | 24 | import os, sys, logging |
25 | import socket | ||
25 | 26 | ||
26 | LOGDIR = "log" | 27 | LOGDIR = "log" |
27 | SETTINGS_FILE = os.path.join(os.path.dirname(__file__), "settings.json") | 28 | SETTINGS_FILE = os.path.join(os.path.dirname(__file__), "settings.json") |
@@ -29,6 +30,26 @@ TEST_DIR_NAME = "tts_testdir" | |||
29 | 30 | ||
30 | OWN_PID = os.getpid() | 31 | OWN_PID = os.getpid() |
31 | 32 | ||
33 | W3C_VALIDATOR = "http://icarus.local/w3c-validator/check?doctype=HTML5&uri=" | ||
34 | |||
35 | #TODO assign port dynamically | ||
36 | TOASTER_PORT=56789 | ||
37 | |||
38 | #we parse the w3c URL to know where to connect | ||
39 | |||
40 | import urlparse | ||
41 | |||
42 | def 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 | |||
50 | TOASTER_BASEURL="http://%s:%d/" % (get_public_ip(), TOASTER_PORT) | ||
51 | |||
52 | |||
32 | OWN_EMAIL_ADDRESS = "Toaster Testing Framework <alexandru.damian@intel.com>" | 53 | OWN_EMAIL_ADDRESS = "Toaster Testing Framework <alexandru.damian@intel.com>" |
33 | REPORT_EMAIL_ADDRESS = "alexandru.damian@intel.com" | 54 | REPORT_EMAIL_ADDRESS = "alexandru.damian@intel.com" |
34 | 55 | ||