From 7f5c64e58014bca82efdb34c0015b091a8c5d84f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 28 Sep 2010 17:59:31 +0300 Subject: [PATCH] (testsuite) Add some [host]:port cases to known hosts related tests. --- test/fixtures/_known_hosts_real/known_hosts | 2 ++ test/fixtures/scp/known_hosts | 1 + test/fixtures/sftp/known_hosts | 1 + test/lib/completions/scp.exp | 8 ++++---- test/lib/completions/sftp.exp | 8 ++++---- test/unit/_known_hosts_real.exp | 12 ++++++------ 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/test/fixtures/_known_hosts_real/known_hosts b/test/fixtures/_known_hosts_real/known_hosts index bf39e848..07e20ecf 100644 --- a/test/fixtures/_known_hosts_real/known_hosts +++ b/test/fixtures/_known_hosts_real/known_hosts @@ -4,3 +4,5 @@ doo ike ssh-rsa qwerty1234/Qwerty+1234== jub,10.0.0.1 kyl,100.0.0.2 +[10.10.0.3]:10022 +[blah]:1234 diff --git a/test/fixtures/scp/known_hosts b/test/fixtures/scp/known_hosts index d54a04d0..2dfa4b6f 100644 --- a/test/fixtures/scp/known_hosts +++ b/test/fixtures/scp/known_hosts @@ -2,3 +2,4 @@ |1|def doo ike ssh-rsa qwerty1234/Qwerty+1234== +[blah]:1234 diff --git a/test/fixtures/sftp/known_hosts b/test/fixtures/sftp/known_hosts index d54a04d0..6538eb4b 100644 --- a/test/fixtures/sftp/known_hosts +++ b/test/fixtures/sftp/known_hosts @@ -2,3 +2,4 @@ |1|def doo ike ssh-rsa qwerty1234/Qwerty+1234== +[10.10.10.10]:2222 diff --git a/test/lib/completions/scp.exp b/test/lib/completions/scp.exp index e1f7336e..4ab514d9 100644 --- a/test/lib/completions/scp.exp +++ b/test/lib/completions/scp.exp @@ -52,12 +52,12 @@ set test "Tab should complete known-hosts" # Build string list of expected completions # Get hostnames and give them a colon (:) suffix # Hosts `gee' and `hus' are defined in ./fixtures/scp/config - # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts + # Hosts `blah', `doo' and `ike' are defined in ./fixtures/scp/known_hosts set expected {} foreach host [get_hosts] { lappend expected "$host:" } -lappend expected doo: gee: hus: ike: +lappend expected blah: doo: gee: hus: ike: # Append local filenames lappend expected config known_hosts "spaced\\ \\ conf" set dir fixtures/scp @@ -90,8 +90,8 @@ foreach host [get_hosts] { lappend expected "$host:" } # Hosts `gee', `hus' and `jar' are defined in "./fixtures/scp/spaced conf" - # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts -lappend expected doo: gee: hus: ike: jar: + # Hosts `blah', `doo' and `ike' are defined in ./fixtures/scp/known_hosts +lappend expected blah: doo: gee: hus: ike: jar: # Append local filenames lappend expected config known_hosts "spaced\\ \\ conf" set dir fixtures/scp diff --git a/test/lib/completions/sftp.exp b/test/lib/completions/sftp.exp index 186a055d..30837ec6 100644 --- a/test/lib/completions/sftp.exp +++ b/test/lib/completions/sftp.exp @@ -18,8 +18,8 @@ setup # Build string list of expected completions set expected [get_hosts] # Hosts `gee' and `hus' are defined in ./fixtures/sftp/config - # Hosts `doo' and `ike' are defined in ./fixtures/sftp/known_hosts -lappend expected doo gee hus ike + # Hosts `10.10.10.10', `doo' and `ike' are defined in ./fixtures/sftp/known_hosts +lappend expected 10.10.10.10 doo gee hus ike set dir fixtures/sftp assert_complete_dir $expected "sftp -F config " $dir @@ -46,8 +46,8 @@ sync_after_int # Get hostnames and give them a colon (:) suffix set expected [get_hosts] # Hosts `gee', `hus' and `jar' are defined in "./fixtures/sftp/spaced conf" - # Hosts `doo' and `ike' are defined in ./fixtures/sftp/known_hosts -lappend expected doo gee hus ike jar + # Hosts `10.10.10.10', `doo' and `ike' are defined in ./fixtures/sftp/known_hosts +lappend expected 10.10.10.10 doo gee hus ike jar set dir fixtures/sftp assert_complete_dir $expected "sftp -F spaced\\ \\ conf " $dir diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp index 31842792..0b1a82f9 100644 --- a/test/unit/_known_hosts_real.exp +++ b/test/unit/_known_hosts_real.exp @@ -17,8 +17,8 @@ setup set test "Hosts should be put in COMPREPLY" set hosts [get_hosts] # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config - # doo, ike, jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts -lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 + # doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3 and blah in ./fixtures/_known_hosts_real/known_hosts +lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY} assert_bash_list $hosts $cmd $test @@ -29,8 +29,8 @@ sync_after_int set test "Hosts should have username prefix and colon suffix" set hosts [get_hosts] # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config - # doo, ike jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts -lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 + # doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3 and blah in ./fixtures/_known_hosts_real/known_hosts +lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 set hosts [lsort -ascii $hosts] set expected {} foreach host $hosts { @@ -103,8 +103,8 @@ set test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE" assert_bash_exec "COMP_KNOWN_HOSTS_WITH_HOSTFILE=" set hosts [get_hosts_avahi] # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config - # doo, ike, jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts -lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 + # doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3 and blah in ./fixtures/_known_hosts_real/known_hosts +lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 # Call _known_hosts set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY} assert_bash_list $hosts $cmd $test