summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/contrib/tts/config.py
diff options
context:
space:
mode:
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