diff options
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 | ||