All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ross Burton" <ross@burtonini.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 5/7] oeqa/core/target: remove server port parameter
Date: Fri, 10 Sep 2021 11:20:48 +0100	[thread overview]
Message-ID: <20210910102050.1266413-5-ross.burton@arm.com> (raw)
In-Reply-To: <20210910102050.1266413-1-ross.burton@arm.com>

Specifying a port that the test host can open sockets on isn't that
useful as the package management tests will open multiple ports, so the
specified port won't be used anyway.  The value was never set so used
the default of value, which meant the kernel picked the port.

Remove the server port parameter entirely, and let the kernel pick a
free port.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/lib/oeqa/core/target/qemu.py   | 1 -
 meta/lib/oeqa/core/target/ssh.py    | 3 +--
 meta/lib/oeqa/runtime/cases/apt.py  | 4 +---
 meta/lib/oeqa/runtime/cases/dnf.py  | 3 +--
 meta/lib/oeqa/runtime/cases/opkg.py | 4 +---
 meta/lib/oeqa/runtime/context.py    | 6 ------
 6 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/meta/lib/oeqa/core/target/qemu.py b/meta/lib/oeqa/core/target/qemu.py
index 7c6e353edf2..66551607fb9 100644
--- a/meta/lib/oeqa/core/target/qemu.py
+++ b/meta/lib/oeqa/core/target/qemu.py
@@ -28,7 +28,6 @@ class OEQemuTarget(OESSHTarget):
 
         super().__init__(logger, None, server_ip, timeout, user, port)
 
-        self.server_port = 0
         self.machine = machine
         self.rootfs = rootfs
         self.kernel = kernel
diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index 4da1e4c2b2d..bbf621c8e38 100644
--- a/meta/lib/oeqa/core/target/ssh.py
+++ b/meta/lib/oeqa/core/target/ssh.py
@@ -15,7 +15,7 @@ from . import OETarget
 
 class OESSHTarget(OETarget):
     def __init__(self, logger, ip, server_ip, timeout=300, user='root',
-                 port=None, server_port=0, **kwargs):
+                 port=None, **kwargs):
         if not logger:
             logger = logging.getLogger('target')
             logger.setLevel(logging.INFO)
@@ -29,7 +29,6 @@ class OESSHTarget(OETarget):
 
         super().__init__(logger, server_ip)
         self.ip = ip
-        self.server_port = server_port
         self.timeout = timeout
         self.user = user
         ssh_options = [
diff --git a/meta/lib/oeqa/runtime/cases/apt.py b/meta/lib/oeqa/runtime/cases/apt.py
index 53745df93f9..ed531a619aa 100644
--- a/meta/lib/oeqa/runtime/cases/apt.py
+++ b/meta/lib/oeqa/runtime/cases/apt.py
@@ -22,9 +22,7 @@ class AptRepoTest(AptTest):
     @classmethod
     def setUpClass(cls):
         service_repo = os.path.join(cls.tc.td['DEPLOY_DIR_DEB'], 'all')
-        cls.repo_server = HTTPService(service_repo,
-                                      '0.0.0.0', port=cls.tc.target.server_port,
-                                      logger=cls.tc.logger)
+        cls.repo_server = HTTPService(service_repo, '0.0.0.0', logger=cls.tc.logger)
         cls.repo_server.start()
 
     @classmethod
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py
index f40c63026e5..937acaab597 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -53,8 +53,7 @@ class DnfRepoTest(DnfTest):
     @classmethod
     def setUpClass(cls):
         cls.repo_server = HTTPService(os.path.join(cls.tc.td['WORKDIR'], 'oe-testimage-repo'),
-                                      '0.0.0.0', port=cls.tc.target.server_port,
-                                      logger=cls.tc.logger)
+                                      '0.0.0.0', logger=cls.tc.logger)
         cls.repo_server.start()
 
     @classmethod
diff --git a/meta/lib/oeqa/runtime/cases/opkg.py b/meta/lib/oeqa/runtime/cases/opkg.py
index 9cfee1cd886..581ddf58749 100644
--- a/meta/lib/oeqa/runtime/cases/opkg.py
+++ b/meta/lib/oeqa/runtime/cases/opkg.py
@@ -25,9 +25,7 @@ class OpkgRepoTest(OpkgTest):
         if cls.tc.td["MULTILIB_VARIANTS"]:
             allarchfeed = cls.tc.td["TUNE_PKGARCH"]
         service_repo = os.path.join(cls.tc.td['DEPLOY_DIR_IPK'], allarchfeed)
-        cls.repo_server = HTTPService(service_repo,
-                                      '0.0.0.0', port=cls.tc.target.server_port,
-                                      logger=cls.tc.logger)
+        cls.repo_server = HTTPService(service_repo, '0.0.0.0', logger=cls.tc.logger)
         cls.repo_server.start()
 
     @classmethod
diff --git a/meta/lib/oeqa/runtime/context.py b/meta/lib/oeqa/runtime/context.py
index 3826f276421..8552aa782bc 100644
--- a/meta/lib/oeqa/runtime/context.py
+++ b/meta/lib/oeqa/runtime/context.py
@@ -99,12 +99,6 @@ 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':
-- 
2.25.1


  parent reply	other threads:[~2021-09-10 10:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 10:20 [PATCH 1/7] testimage: TEST_SERVER_IP isn't mandatory Ross Burton
2021-09-10 10:20 ` [PATCH 2/7] testimage: pass the base image name to the target class Ross Burton
2021-09-10 10:20 ` [PATCH 3/7] oeqa/core/target: remove abstract decorations Ross Burton
2021-09-10 10:20 ` [PATCH 4/7] oeqa/core/target: move server_ip to superclass Ross Burton
2021-09-10 10:20 ` Ross Burton [this message]
2021-09-10 10:20 ` [PATCH 6/7] oeqa/core/target: add target_ip " Ross Burton
2021-09-10 10:20 ` [PATCH 7/7] oeqa/target/ssh: don't assume target_dumper is set Ross Burton
2021-09-10 12:21 ` [OE-core] [PATCH 1/7] testimage: TEST_SERVER_IP isn't mandatory Ross Burton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210910102050.1266413-5-ross.burton@arm.com \
    --to=ross@burtonini.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.