]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oeqa/runtime: smart: serve repo on host ip only and increase timeout
authorStefan Stanacar <stefanx.stanacar@intel.com>
Tue, 3 Sep 2013 13:01:11 +0000 (16:01 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 3 Sep 2013 18:57:31 +0000 (19:57 +0100)
Don't start the http server on 0.0.0.0, listen on host ip (end of tap interface) only.
Also use the timeout option (default is 300s for ssh commands) for all the commands
run in this module (mostly because smart update timeouts on mips).

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/smart.py
meta/lib/oeqa/utils/httpserver.py

index 6e20f9696747b21105c9a37a0fc1ded255866e68..59083ca817f45cbbf0dc9fdccb3ba63b2cd75a17 100644 (file)
@@ -17,7 +17,7 @@ class SmartTest(oeRuntimeTest):
     @skipUnlessPassed('test_smart_help')
     def smart(self, command, expected = 0):
         command = 'smart %s' % command
-        status, output = self.target.run(command)
+        status, output = self.target.run(command, 500)
         message = os.linesep.join([command, output])
         self.assertEqual(status, expected, message)
         self.assertFalse("Cannot allocate memory" in output, message)
@@ -48,7 +48,7 @@ class SmartRepoTest(SmartTest):
 
     @classmethod
     def setUpClass(self):
-        self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True))
+        self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), oeRuntimeTest.tc.qemu.host_ip)
         self.repo_server.start()
 
     @classmethod
index d4b61547e86794f945320f153432136861ffcfb8..f161a1bddd02538e5549d5f64d44315c9d8983f2 100644 (file)
@@ -15,12 +15,13 @@ class HTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
 
 class HTTPService(object):
 
-    def __init__(self, root_dir):
+    def __init__(self, root_dir, host=''):
         self.root_dir = root_dir
+        self.host = host
         self.port = 0
 
     def start(self):
-        self.server = HTTPServer(('', self.port), HTTPRequestHandler)
+        self.server = HTTPServer((self.host, self.port), HTTPRequestHandler)
         if self.port == 0:
             self.port = self.server.server_port
         self.process = multiprocessing.Process(target=self.server.server_start, args=[self.root_dir])