File 2526-Add-test-for-post-authentication-compression.patch of Package erlang

From 09ffb0e8dd15edc170a55d584961b6f91401b6ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20W=C4=85sowski?= <michal@erlang.org>
Date: Mon, 9 Mar 2026 17:25:04 +0100
Subject: [PATCH 6/6] Add test for post-authentication compression

---
 lib/ssh/test/ssh_basic_SUITE.erl | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index 9a88fe3fab..b4751d21fd 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -56,6 +56,7 @@
          double_close/1,
          exec/1,
          exec_compressed/1,
+         exec_compressed_post_auth_compression/1,
          exec_with_io_in/1,
          exec_with_io_out/1,
          host_equal/2,
@@ -153,7 +154,7 @@ groups() ->
                                            ]},
      
      {p_basic, [?PARALLEL], [send, peername_sockname,
-                             exec, exec_compressed, 
+                             exec, exec_compressed, exec_compressed_post_auth_compression,
                              exec_with_io_out, exec_with_io_in,
                              cli, cli_exit_normal, cli_exit_status,
                              idle_time_client, idle_time_server,
@@ -401,19 +402,29 @@ exec_with_io_in(Config) when is_list(Config) ->
 %%--------------------------------------------------------------------
 %%% Test that compression option works
 exec_compressed(Config) when is_list(Config) ->
+    exec_compressed_helper(Config, 'zlib').
+
+%%--------------------------------------------------------------------
+%%% Test that post authentication compression option works
+exec_compressed_post_auth_compression(Config) when is_list(Config) ->
+    exec_compressed_helper(Config, 'zlib@openssh.com').
+
+%%--------------------------------------------------------------------
+%%% Exec compressed helper
+exec_compressed_helper(Config, CompressAlgorithm) ->
     process_flag(trap_exit, true),
     SystemDir = filename:join(proplists:get_value(priv_dir, Config), system),
     UserDir = proplists:get_value(priv_dir, Config),
 
     {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},{user_dir, UserDir},
-                                             {preferred_algorithms,[{compression, [zlib]}]},
+                                             {preferred_algorithms,[{compression, [CompressAlgorithm]}]},
                                              {failfun, fun ssh_test_lib:failfun/2}]),
 
     ConnectionRef =
         ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true},
                                           {user_dir, UserDir},
                                           {user_interaction, false},
-                                          {preferred_algorithms,[{compression, [zlib]}]}]),
+                                          {preferred_algorithms,[{compression, [CompressAlgorithm]}]}]),
     {ok, ChannelId} = ssh_connection:session_channel(ConnectionRef, infinity),
     success = ssh_connection:exec(ConnectionRef, ChannelId,
                                   "1+1.", infinity),
-- 
2.51.0

openSUSE Build Service is sponsored by