I am trying to run the following command in karate using karate.fork
ssh -o ProxyCommand="ssh -W %h:%p -i ~/.ssh/id_rsa root@myjumphost" -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no -o PasswordAuthentication=no root@finaldest echo test
I have broken this up into an array to pass to karate.fork
like so:
[
ssh,
-o,
ProxyCommand="ssh -W %h:%p -i ~/.ssh/id_rsa root@myjumphost",
-i,
~/.ssh/id_rsa,
-o,
StrictHostKeyChecking=no,
-o,
PasswordAuthentication=no,
root@finaldest,
echo test
]
Then run the command like so:
* karate.fork(args)
where args
is the array mentioned above
The command works when I paste it into the terminal and run it manually, however when run with karate.fork
I get
zsh:1: no such file or directory: ssh -W finaldest:22 -I ~/.ssh/id_rsa root@myjumphost
kex_exchange_identification: Connection closed by remote host
I have tried adding a few backslashes before the "
in the ProxyCommand
but no amount of back slashes fixes this issue. I think I am misunderstanding what karate.fork
is doing to run the command, is there some internal parsing or manipulating of the given input? I was able to get this command to work when I used useShell: true
however this option breaks other tests for me so I would really like to avoid it.