Common test: ct_ssh usage?
Mikkel Jensen
emailos@REDACTED
Sat Aug 14 11:17:48 CEST 2010
Hi
Im having a hard time using ct_ssh to just create a simple connection. This
shouldn't be hard, but for some reason it is. I have been using
http://www.erlang.org/doc/man/ct_ssh.html as the base of my efforts. My
attempts at making a connection is shown below.
If anyone could give me any tips or pointers to get me started, it would be
much appreciated!
1. -module(simple).
2. -export([run/0]).
3.
4. -import(ct_ssh).
5. -import(ct_util).
6.
7. run() ->
8. ok = ct:require(mynodename,{sec,[ssh,"127.0.0.1"]}),
9. {ok, Handle} = ct_ssh:connect(mynodename),
10. Handle.
11.
12.
13. ERROR:
14. ------
15.
16. 1> simple:run().
17. ** exception error: bad argument
18. in function ct_util:call/1
19. in call from simple:run/0
20. 2> crypto:start().
21. ok
22. 3> ssh:start().
23. ok
24. 4> simple:run().
25. ** exception error: bad argument
26. in function ct_util:call/1
27. in call from simple:run/0
28.
1. -module(solossh).
2. -export([soloconnect/0]).
3. -import(ct_ssh).
4.
5. soloconnect() ->
6. {ok, Handle} = ct_ssh:connect(host, ssh, [{ssh, "127.0.0.1"},
{port, "22"}, {user, "testserver"}, {password, "testpass"}]),
7. Handle.
8.
9.
10. error
11. ------
12.
13. 1> solossh:soloconnect().
14. ** exception error: bad argument
15. in function ets:select/2
16. called as ets:select(ct_attributes,
17. [{{ct_conf,'_','$2','$1',host,'_'},[],[{
{'$1','$2'}}]}])
18. in call from ct_util:lookup_name/1
19. in call from ct_util:lookup_config/1
20. in call from ct_util:get_config/3
21. in call from ct_ssh:connect/3
22. in call from solossh:soloconnect/0
More information about the erlang-questions
mailing list