aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-05-13 16:12:10 +0200
committerSiri Hansen <[email protected]>2013-05-14 11:07:11 +0200
commit4d086abb73f7b9af178c966d5fb66012c4ec6612 (patch)
tree2577db14f5fe4e5e80bdc9bbb073f4ac59a3f769 /lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl
parentce4905a124ed2dd7bd08f994b83f803232d7e5f7 (diff)
downloadotp-4d086abb73f7b9af178c966d5fb66012c4ec6612.tar.gz
otp-4d086abb73f7b9af178c966d5fb66012c4ec6612.tar.bz2
otp-4d086abb73f7b9af178c966d5fb66012c4ec6612.zip
[common_test] Add test for ct_telnet using own telnet server
The new test suite ct_telnet_SUITE_data/ct_telnet_own_server_SUITE uses the very simple telnet_server.erl located in the common_test test directory.
Diffstat (limited to 'lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl')
-rw-r--r--lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl b/lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl
new file mode 100644
index 0000000000..2173c68c11
--- /dev/null
+++ b/lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl
@@ -0,0 +1,46 @@
+-module(ct_telnet_own_server_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+
+suite() -> [{require,erl_telnet_server,{unix,[telnet]}}].
+
+all() ->
+ [expect,
+ expect_repeat].
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+expect(_) ->
+ {ok, Handle} = ct_telnet:open(erl_telnet_server),
+ ok = ct_telnet:send(Handle, "echo ayt"),
+ {ok,["ayt"]} = ct_telnet:expect(Handle, ["ayt"]),
+ ok = ct_telnet:close(Handle),
+ ok.
+
+expect_repeat(_) ->
+ {ok, Handle} = ct_telnet:open(erl_telnet_server),
+ ok = ct_telnet:send(Handle, "repeat xy"),
+ {ok,[["xy"],["xy"]],done} = ct_telnet:expect(Handle, ["xy"],
+ [{repeat,2}]),
+ ok = ct_telnet:close(Handle),
+ ok.