diff options
| author | Gabriel F. T. Gomes <gabriel@inconstante.eti.br> | 2017-09-25 23:46:54 -0300 |
|---|---|---|
| committer | Gabriel F. T. Gomes <gabriel@inconstante.eti.br> | 2017-09-25 23:46:54 -0300 |
| commit | 6d88f1055806932d9291f96847d2b691cccda2cd (patch) | |
| tree | 0ff79eedaa8a239331256048981deedbd0721965 /test/unit/_known_hosts_real.exp | |
| parent | 059a87a5936cfebfd2d71ab8057002cafb2ea051 (diff) | |
| download | bash-completion-6d88f1055806932d9291f96847d2b691cccda2cd.tar.gz | |
New upstream version 2.7upstream/2.7
Diffstat (limited to 'test/unit/_known_hosts_real.exp')
| -rw-r--r-- | test/unit/_known_hosts_real.exp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp index 30ede41c..c065f766 100644 --- a/test/unit/_known_hosts_real.exp +++ b/test/unit/_known_hosts_real.exp @@ -120,4 +120,32 @@ assert_bash_exec "unset -v COMP_KNOWN_HOSTS_WITH_HOSTFILE" sync_after_int +set test "Included config files should work" +set hosts [get_hosts -unsorted] + # Host 'recursion' is defined in ./fixtures/_known_hosts_real/config_include_recursion + # Host 'relative_path' is defined in ./fixtures/_known_hosts_real/.ssh/config_relative_path +lappend hosts recursion relative_path +set hosts [join [bash_sort $hosts] "\\s+"] + # Setup environment + # Redefined HOME to handle relative path inclusions on $HOME/.ssh +set cmd {OLDHOME=$HOME; HOME="$SRCDIRABS/fixtures/_known_hosts_real"} +send "$cmd\r" +expect -ex "$cmd\r\n/@" + # Call _known_hosts +set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config_include ''; echo_array COMPREPLY} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -re "^$hosts\r\n/@$" { pass "$test" } + default { unresolved "$test" } +} + # Teardown environment +set cmd {HOME=$OLDHOME} +send "$cmd\r" +expect -ex "$cmd\r\n/@" + + +sync_after_int + + teardown |
