From a487ad4cbeffec452e44a9376b8c361f9cc24153 Mon Sep 17 00:00:00 2001 From: yrutschle Date: Sat, 17 Apr 2021 21:28:55 +0200 Subject: [PATCH] fix ssh test and add random delays to exercise probing code --- t_load | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/t_load b/t_load index 8ac21fb..ff2a0ee 100755 --- a/t_load +++ b/t_load @@ -44,7 +44,7 @@ my $stop_client_probability = .001; # What protocols we test, and on what ports # Just comment out protocols you don't want to use. my %protocols = ( - #"ssh" => { address => "localhost:9001", client => client("ssh") }, + "ssh" => { address => "localhost:9000" }, # "tls" => { address => "localhost:9002", client => client("tls") }, "openvpn" => {address => "localhost:9004" }, "tinc" => {address => "localhost:9003" }, @@ -63,14 +63,22 @@ sub connect_service { my ($test_data, $r); - sleep 5 if $service eq "ssh"; + if ($service eq "ssh") { + sleep rand 20; + $test_data = "SSH-2.0 hello"; + syswrite $cnx, $test_data; + sleep 1; + sysread $cnx, $r, 18; # length "ssh: SSH-2.0 hello" => 18 + } if ($service eq "openvpn") { + sleep rand 10; $test_data = "\x00\x00"; syswrite $cnx, $test_data; sleep 1; sysread $cnx, $r, 11; # length "openvpn: \x0\x0" => 11 } if ($service eq "tinc") { + sleep rand 10; $test_data = "0 "; syswrite $cnx, $test_data; sleep 1;