]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runtime/context.py: support listening port in TEST_SERVER_IP
authorAndré Draszik <git@andred.net>
Thu, 12 Dec 2019 21:52:10 +0000 (21:52 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Dec 2019 23:22:03 +0000 (23:22 +0000)
Similar to the existing possibility to specify a port in
TEST_TARGET_IP, allow TEST_SERVER_IP to also contain a
port.

The intention is for this port to be passed into e.g.
the http server from the apt / dnf / opkg tests, or
any other (custom) tests that might need the target to
connect to a service spawned by bitbake / oeqa, where
bitbake is actually running inside a docker container.

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/context.py

index ef738a33598a9c3b3107cb13b1aaad5ddeee7087..2ecb1a8f012df890451b407b40e83540fca399b1 100644 (file)
@@ -98,6 +98,12 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
                 target_ip = target_ip_port[0]
                 kwargs['port'] = target_ip_port[1]
 
+        if server_ip:
+            server_ip_port = server_ip.split(':')
+            if len(server_ip_port) == 2:
+                server_ip = server_ip_port[0]
+                kwargs['server_port'] = int(server_ip_port[1])
+
         if target_type == 'simpleremote':
             target = OESSHTarget(logger, target_ip, server_ip, **kwargs)
         elif target_type == 'qemu':