88-export ([frame_size_test_case /1 ,
99 greetings_test_case /1 ,
1010 session_test_case /1 ,
11+ simple_hello_test_case /1 ,
1112 valid_command_test_case /1 ,
1213 long_message_test_case /1 ,
1314 invalid_command_test_case /1 ,
@@ -18,6 +19,7 @@ all() ->
1819 [frame_size_test_case ,
1920 greetings_test_case ,
2021 session_test_case ,
22+ simple_hello_test_case ,
2123 valid_command_test_case ,
2224 long_message_test_case ,
2325 invalid_command_test_case ,
@@ -51,6 +53,17 @@ greetings_test_case(Config) ->
5153 match_data (Data , " <greeting>" ),
5254 ok .
5355
56+ simple_hello_test_case (Config ) ->
57+ Options = proplists :get_value (tcp_options , Config ),
58+ {ok , Socket } = gen_tcp :connect (" localhost" , 1180 , Options , 2000 ),
59+ _Data = receive_data (Socket ),
60+ ok = send_data (hello_command (), Socket ),
61+ HelloResponse = receive_data (Socket ),
62+ match_data (HelloResponse ,
63+ " <extURI>urn:ietf:params:xml:ns:secDNS-1.1</extURI>" ),
64+ match_data (HelloResponse , " https://epp.tld.ee/schema/eis-1.0.xsd" ),
65+ ok .
66+
5467session_test_case (Config ) ->
5568 Options = proplists :get_value (tcp_options , Config ),
5669 {ok , Socket } = gen_tcp :connect (" localhost" , 1180 , Options , 2000 ),
@@ -212,6 +225,12 @@ match_data(Data, Pattern) ->
212225 {ok , MatchPattern } = re :compile (Pattern ),
213226 {match , _Captured } = re :run (Data , MatchPattern ).
214227
228+ hello_command () ->
229+ <<" <?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" no\" ?>" ,
230+ " <epp xmlns=\" https://epp.tld.ee/schema/epp-ee-1.0.xsd\" >" ,
231+ " <hello/>" ,
232+ " </epp>" >>.
233+
215234login_command () ->
216235 <<" <?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" no\" ?>\n "
217236 " <epp xmlns=\" https://epp.tld.ee/schema/epp-ee-1.0.xsd\" >\n "
0 commit comments