-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fold ssh_with_forwarding command into ssh command
- Loading branch information
1 parent
50e7a5b
commit be16039
Showing
1 changed file
with
25 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,8 +86,9 @@ parse_ktest_arg() | |
x) | ||
set -x | ||
;; | ||
f) | ||
ktest_ssh_port=$OPTARG | ||
f) | ||
ktest_ssh_port=$OPTARG | ||
;; | ||
esac | ||
} | ||
|
||
|
@@ -183,37 +184,29 @@ ktest_boot() | |
|
||
ktest_ssh() | ||
{ | ||
sock=$ktest_vmdir/net | ||
ip="10.0.2.2" | ||
|
||
(cd "$ktest_dir/lib"; make lwip-connect) > /dev/null | ||
|
||
exec ssh -t -F /dev/null \ | ||
-o CheckHostIP=no \ | ||
-o StrictHostKeyChecking=no \ | ||
-o UserKnownHostsFile=/dev/null \ | ||
-o NoHostAuthenticationForLocalhost=yes \ | ||
-o ServerAliveInterval=2 \ | ||
-o ControlMaster=auto \ | ||
-o ControlPath="$ktest_vmdir/controlmaster" \ | ||
-o ControlPersist=yes \ | ||
-o ProxyCommand="$ktest_dir/lib/lwip-connect $sock $ip 22" \ | ||
[email protected] "$@" | ||
} | ||
local ssh_cmd=(ssh -t -F /dev/null \ | ||
-o CheckHostIP=no \ | ||
-o StrictHostKeyChecking=no \ | ||
-o UserKnownHostsFile=/dev/null \ | ||
-o NoHostAuthenticationForLocalhost=yes \ | ||
-o ServerAliveInterval=2 \ | ||
-o ControlMaster=auto \ | ||
-o ControlPath="$ktest_vmdir/controlmaster" \ | ||
-o ControlPersist=yes \ | ||
) | ||
|
||
if [[ $ktest_ssh_port = 0 ]]; then | ||
sock=$ktest_vmdir/net | ||
ip="10.0.2.2" | ||
|
||
(cd "$ktest_dir/lib"; make lwip-connect) > /dev/null | ||
|
||
ssh_cmd+=(-o ProxyCommand="$ktest_dir/lib/lwip-connect $sock $ip 22") | ||
else | ||
ssh_cmd+=(-p $ktest_ssh_port) | ||
fi | ||
|
||
ktest_ssh_with_forwarding() | ||
{ | ||
exec ssh -t -F /dev/null \ | ||
-o CheckHostIP=no \ | ||
-o StrictHostKeyChecking=no \ | ||
-o UserKnownHostsFile=/dev/null \ | ||
-o NoHostAuthenticationForLocalhost=yes \ | ||
-o ServerAliveInterval=2 \ | ||
-o ControlMaster=auto \ | ||
-o ControlPath="$ktest_vmdir/controlmaster" \ | ||
-o ControlPersist=yes \ | ||
-p $ktest_ssh_port \ | ||
[email protected] "$@" | ||
exec "${ssh_cmd[@]}" [email protected] "$@" | ||
} | ||
|
||
ktest_gdb() | ||
|