public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] testsuite: Save ssh command stdout/stderr in case of failure
@ 2024-08-05  7:06 Uladzimir Bely
  2024-08-07 14:36 ` Uladzimir Bely
  0 siblings, 1 reply; 2+ messages in thread
From: Uladzimir Bely @ 2024-08-05  7:06 UTC (permalink / raw)
  To: isar-users

When ssh command returns non-zero code we stop test execution via
"self.fail" and thus loose stdout and stderr that ssh_start/vm_start
are expected to return.

Save both stdout and stderr to the whiteboard file.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 testsuite/cibuilder.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index 35af3d9c..3f77cd42 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -474,6 +474,7 @@ class CIBuilder(Test):
             rc, stdout, stderr = self.remote_run(cmd, script)
 
             if rc != 0:
+                self.whiteboard += f'stdout:\n{stdout}\n\nstderr:\n{stderr}\n'
                 self.fail(f"Failed with rc={rc}")
 
             return stdout, stderr
@@ -689,6 +690,7 @@ class CIBuilder(Test):
             if rc != 0:
                 if not keep:
                     self.vm_turn_off(vm)
+                self.whiteboard += f'stdout:\n{stdout}\n\nstderr:\n{stderr}\n'
                 self.fail("Failed to run test over ssh")
         else:
             multiconfig = 'mc:qemu' + arch + '-' + distro + ':' + image
-- 
2.44.2

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240805070616.18365-1-ubely%40ilbers.de.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] testsuite: Save ssh command stdout/stderr in case of failure
  2024-08-05  7:06 [PATCH] testsuite: Save ssh command stdout/stderr in case of failure Uladzimir Bely
@ 2024-08-07 14:36 ` Uladzimir Bely
  0 siblings, 0 replies; 2+ messages in thread
From: Uladzimir Bely @ 2024-08-07 14:36 UTC (permalink / raw)
  To: isar-users

On Mon, 2024-08-05 at 10:06 +0300, Uladzimir Bely wrote:
> When ssh command returns non-zero code we stop test execution via
> "self.fail" and thus loose stdout and stderr that ssh_start/vm_start
> are expected to return.
> 
> Save both stdout and stderr to the whiteboard file.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  testsuite/cibuilder.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
> index 35af3d9c..3f77cd42 100755
> --- a/testsuite/cibuilder.py
> +++ b/testsuite/cibuilder.py
> @@ -474,6 +474,7 @@ class CIBuilder(Test):
>              rc, stdout, stderr = self.remote_run(cmd, script)
>  
>              if rc != 0:
> +                self.whiteboard +=
> f'stdout:\n{stdout}\n\nstderr:\n{stderr}\n'
>                  self.fail(f"Failed with rc={rc}")
>  
>              return stdout, stderr
> @@ -689,6 +690,7 @@ class CIBuilder(Test):
>              if rc != 0:
>                  if not keep:
>                      self.vm_turn_off(vm)
> +                self.whiteboard +=
> f'stdout:\n{stdout}\n\nstderr:\n{stderr}\n'
>                  self.fail("Failed to run test over ssh")
>          else:
>              multiconfig = 'mc:qemu' + arch + '-' + distro + ':' +
> image
> -- 
> 2.44.2
> 

Applied to next.

-- 
Best regards,
Uladzimir.



-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/ee68f45d2d7201ebf9c75d2889c944b0a2d066e5.camel%40ilbers.de.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-07 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-05  7:06 [PATCH] testsuite: Save ssh command stdout/stderr in case of failure Uladzimir Bely
2024-08-07 14:36 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox