diff mbox series

[net-next,1/4] selftests: drv-net: force pseudo-terminal allocation in ssh

Message ID 20240424221444.4194069-2-kuba@kernel.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series selftests: drv-net: round some sharp edges | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 1 maintainers not CCed: shuah@kernel.org
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-25--09-00 (tests: 995)

Commit Message

Jakub Kicinski April 24, 2024, 10:14 p.m. UTC
This is not yet needed, because we don't terminate remote background
commands. But once we do, if we run ssh without -t the ssh session
may close and the program may carry on happily running.

I have hit this problem experimenting with mausezahn, let's fix
it already to avoid someone else wasting time debugging it.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 tools/testing/selftests/drivers/net/lib/py/remote_ssh.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski April 24, 2024, 10:56 p.m. UTC | #1
On Wed, 24 Apr 2024 15:14:41 -0700 Jakub Kicinski wrote:
> This is not yet needed, because we don't terminate remote background
> commands. But once we do, if we run ssh without -t the ssh session
> may close and the program may carry on happily running.
> 
> I have hit this problem experimenting with mausezahn, let's fix
> it already to avoid someone else wasting time debugging it.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
>  tools/testing/selftests/drivers/net/lib/py/remote_ssh.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/drivers/net/lib/py/remote_ssh.py b/tools/testing/selftests/drivers/net/lib/py/remote_ssh.py
> index 924addde19a3..294a4ed8284e 100644
> --- a/tools/testing/selftests/drivers/net/lib/py/remote_ssh.py
> +++ b/tools/testing/selftests/drivers/net/lib/py/remote_ssh.py
> @@ -20,7 +20,7 @@ from lib.py import cmd
>              self._tmpdir = None
>  
>      def cmd(self, comm):
> -        return subprocess.Popen(["ssh", "-q", self.name, comm],
> +        return subprocess.Popen(["ssh", "-t", "-q", self.name, comm],
>                                  stdout=subprocess.PIPE, stderr=subprocess.PIPE)

This seems to mess up the local terminal. I guess we'll cross that
bridge when we get there... I'll drop this patch when applying.
diff mbox series

Patch

diff --git a/tools/testing/selftests/drivers/net/lib/py/remote_ssh.py b/tools/testing/selftests/drivers/net/lib/py/remote_ssh.py
index 924addde19a3..294a4ed8284e 100644
--- a/tools/testing/selftests/drivers/net/lib/py/remote_ssh.py
+++ b/tools/testing/selftests/drivers/net/lib/py/remote_ssh.py
@@ -20,7 +20,7 @@  from lib.py import cmd
             self._tmpdir = None
 
     def cmd(self, comm):
-        return subprocess.Popen(["ssh", "-q", self.name, comm],
+        return subprocess.Popen(["ssh", "-t", "-q", self.name, comm],
                                 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 
     def _mktmp(self):