]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oeqa-runtime: fix run_network_serialdebug
authorPeter Marko <peter.marko@siemens.com>
Tue, 13 Jan 2026 08:54:43 +0000 (09:54 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 15 Jan 2026 22:46:04 +0000 (22:46 +0000)
This is a global function and thus does not have self object.
Executing it leads to "NameError: name 'self' is not defined".

Change it to take parent object which contains all data which is needed
to execute it.

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/case.py
meta/lib/oeqa/runtime/cases/ping.py
meta/lib/oeqa/runtime/cases/ssh.py

index 2a47771a3d47879c0e363f7300269d716fe7fbc8..095bcf434aa6142a7b57bfdaf17a50400dfb9b3a 100644 (file)
@@ -22,15 +22,15 @@ class OERuntimeTestCase(OETestCase):
         super(OERuntimeTestCase, self).tearDown()
         uninstall_package(self)
 
-def run_network_serialdebug(runner):
-    if not runner:
+def run_network_serialdebug(target):
+    if not target.runner:
         return
-    status, output = runner.run_serial("ip addr")
+    status, output = target.runner.run_serial("ip addr")
     print("ip addr on target: %s %s" % (output, status))
-    status, output = runner.run_serial("ping -c 1 %s" % self.target.server_ip)
-    print("ping on target for %s: %s %s" % (self.target.server_ip, output, status))
-    status, output = runner.run_serial("ping -c 1 %s" % self.target.ip)
-    print("ping on target for %s: %s %s" % (self.target.ip, output, status))
+    status, output = target.runner.run_serial("ping -c 1 %s" % target.server_ip)
+    print("ping on target for %s: %s %s" % (target.server_ip, output, status))
+    status, output = target.runner.run_serial("ping -c 1 %s" % target.ip)
+    print("ping on target for %s: %s %s" % (target.ip, output, status))
     # Have to use a full path for netstat which isn't in HOSTTOOLS
     subprocess.call(["/usr/bin/netstat", "-tunape"])
     subprocess.call(["/usr/bin/netstat", "-ei"])
index efb91d4cc9da93028e1ed29f339eeab6c7536a64..baea1b385bafa4f467d3ab09bfb76483e1adb4b7 100644 (file)
@@ -36,7 +36,7 @@ class PingTest(OERuntimeTestCase):
                     count = 0
                     sleep(1)
         except OEQATimeoutError:
-            run_network_serialdebug(self.target.runner)
+            run_network_serialdebug(self.target)
             self.fail("Ping timeout error for address %s, count %s, output: %s" % (self.target.ip, count, output))
         msg = ('Expected 5 consecutive, got %d.\n'
                'ping output is:\n%s' % (count,output))
index 3e9503277e39b281ffa7dc5f08f975ba2e96cee5..5fa4bb98b57cb895161798f7fee0140217854fdd 100644 (file)
@@ -32,7 +32,7 @@ class SSHTest(OERuntimeTestCase):
               time.sleep(5)
               continue
           else:
-              run_network_serialdebug(self.target.runner)
+              run_network_serialdebug(self.target)
               self.fail("uname failed with \"%s\" (exit code %s)" % (output, status))
         if status != 0:
             self.fail("ssh failed with \"%s\" (exit code %s)" % (output, status))