=== Test case: rest_SUITE:messages_error_handling/1 (click for source code)

=== Config value:

    [{watchdog,<0.27106.1>},
     {{ejabberd_cwd,mongooseim@localhost},
      "/home/circleci/project/_build/mim1/rel/mongooseim"},
     {mam_backend,rdbms},
     {mim_data_dir,"/home/circleci/project/big_tests/tests/rest_SUITE_data"},
     {preset,"odbc_mssql_mnesia"},
     {tc_logfile,"/home/circleci/project/big_tests/ct_report/ct_run.test@88d84ff17c71.2022-03-04_11.16.52/big_tests.tests.rest_SUITE.logs/run.2022-03-04_11.25.01/rest_suite.messages_error_handling.149762.html"},
     {tc_group_properties,[{name,admin},parallel]},
     {tc_group_path,[]},
     {data_dir,"/home/circleci/project/big_tests/_build/default/lib/mongoose_tests/ebin/rest_SUITE_data/"},
     {priv_dir,"/home/circleci/project/big_tests/ct_report/ct_run.test@88d84ff17c71.2022-03-04_11.16.52/big_tests.tests.rest_SUITE.logs/run.2022-03-04_11.25.01/log_private/"},
     {escalus_users,[{alice,[{username,<<"alicE">>},
                             {server,<<"domain.example.com">>},
                             {host,<<"localhost">>},
                             {password,<<"matygrysa">>}]},
                     {bob,[{username,<<"bOb">>},
                           {server,<<"domain.example.com">>},
                           {host,<<"localhost">>},
                           {password,<<"makrolika">>}]}]}]

=== Current directory is "/home/circleci/project/big_tests/ct_report/ct_run.test@88d84ff17c71.2022-03-04_11.16.52"

=== Started at 2022-03-04 11:25:01


*** CT 2022-03-04 11:25:01.254 *** View log from node mongooseim@localhost when started mongooseim@localhost_2410.html
*** CT 2022-03-04 11:25:01.254 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_646.html

*** User 2022-03-04 11:25:01.277 ***
alicE_messages_error_handling_1788@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-04 11:25:01.277 ***
alicE_messages_error_handling_1788@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='80bb6bc16c56df6e' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.277 ***
alicE_messages_error_handling_1788@domain.example.com/res1 in
<stream:features>
	<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
		<mechanism>SCRAM-SHA-256</mechanism>
		<mechanism>PLAIN</mechanism>
	</mechanisms>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-03-04 11:25:01.277 ***
alicE_messages_error_handling_1788@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFsaWNFX21lc3NhZ2VzX2Vycm9yX2hhbmRsaW5nXzE3ODgAbWF0eWdyeXNh</auth>



*** User 2022-03-04 11:25:01.283 ***
alicE_messages_error_handling_1788@domain.example.com/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-03-04 11:25:01.284 ***
alicE_messages_error_handling_1788@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-04 11:25:01.284 ***
alicE_messages_error_handling_1788@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='e8420fb88e724638' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.284 ***
alicE_messages_error_handling_1788@domain.example.com/res1 in
<stream:features>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-03-04 11:25:01.284 ***
alicE_messages_error_handling_1788@domain.example.com/res1 out
<iq type='set' id='987c50d863ec4cad87acabdceb1c0431'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-03-04 11:25:01.284 ***
alicE_messages_error_handling_1788@domain.example.com/res1 in
<iq id='987c50d863ec4cad87acabdceb1c0431' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>alicE_messages_error_handling_1788@domain.example.com/res1</jid>
	</bind>
</iq>



*** User 2022-03-04 11:25:01.285 ***
alicE_messages_error_handling_1788@domain.example.com/res1 out
<iq type='set' id='6c75100f134dd5714bf3afab3d1d0104'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-04 11:25:01.285 ***
alicE_messages_error_handling_1788@domain.example.com/res1 in
<iq type='result' id='6c75100f134dd5714bf3afab3d1d0104'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-04 11:25:01.285 ***
alicE_messages_error_handling_1788@domain.example.com/res1 out
<presence/>



*** User 2022-03-04 11:25:01.287 ***
alicE_messages_error_handling_1788@domain.example.com/res1 in
<presence from='alicE_messages_error_handling_1788@domain.example.com/res1' to='alice_messages_error_handling_1788@domain.example.com/res1' xml:lang='en'/>



*** User 2022-03-04 11:25:01.288 ***
bOb_messages_error_handling_1788@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-04 11:25:01.288 ***
bOb_messages_error_handling_1788@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='f1579cd7a394c37a' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.288 ***
bOb_messages_error_handling_1788@domain.example.com/res1 in
<stream:features>
	<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
		<mechanism>SCRAM-SHA-256</mechanism>
		<mechanism>PLAIN</mechanism>
	</mechanisms>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-03-04 11:25:01.288 ***
bOb_messages_error_handling_1788@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYl9tZXNzYWdlc19lcnJvcl9oYW5kbGluZ18xNzg4AG1ha3JvbGlrYQ==</auth>



*** User 2022-03-04 11:25:01.289 ***
bOb_messages_error_handling_1788@domain.example.com/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-03-04 11:25:01.289 ***
bOb_messages_error_handling_1788@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-04 11:25:01.289 ***
bOb_messages_error_handling_1788@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1731e1091ba5a074' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.289 ***
bOb_messages_error_handling_1788@domain.example.com/res1 in
<stream:features>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-03-04 11:25:01.289 ***
bOb_messages_error_handling_1788@domain.example.com/res1 out
<iq type='set' id='78c0f56bacbe553ba9d2231521e40131'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-03-04 11:25:01.290 ***
bOb_messages_error_handling_1788@domain.example.com/res1 in
<iq id='78c0f56bacbe553ba9d2231521e40131' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb_messages_error_handling_1788@domain.example.com/res1</jid>
	</bind>
</iq>



*** User 2022-03-04 11:25:01.290 ***
bOb_messages_error_handling_1788@domain.example.com/res1 out
<iq type='set' id='5d1cda31dfc58fec96a05412f21fc5cf'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-04 11:25:01.290 ***
bOb_messages_error_handling_1788@domain.example.com/res1 in
<iq type='result' id='5d1cda31dfc58fec96a05412f21fc5cf'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-04 11:25:01.290 ***
bOb_messages_error_handling_1788@domain.example.com/res1 out
<presence/>



*** User 2022-03-04 11:25:01.293 ***
bOb_messages_error_handling_1788@domain.example.com/res1 in
<presence from='bOb_messages_error_handling_1788@domain.example.com/res1' to='bob_messages_error_handling_1788@domain.example.com/res1' xml:lang='en'/>



*** User 2022-03-04 11:25:01.294 ***
REST request fails:
Code: 400
Req: {<0.27329.1>,<<"/api/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"ca71e2edf6110645">>}],
      <<"{\"to\":\"@noway\",\"caller\":\"alice_messages_error_handling_1788@domain.example.com\",\"body\":\"whatever\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Fri, 04 Mar 2022 11:25:00 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"25">>}],
         <<"Invalid jid: <<\"@noway\">>">>,158,637}
Params: #{body =>
              <<"{\"to\":\"@noway\",\"caller\":\"alice_messages_error_handling_1788@domain.example.com\",\"body\":\"whatever\"}">>,
          method => <<"POST">>,path => <<"/api/messages">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-04 11:25:01.340 ***
REST request fails:
Code: 400
Req: {<0.27339.1>,<<"/api/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"d197a919c2a77310">>}],
      <<"{\"to\":\"bob_messages_error_handling_1788@domain.example.com\",\"caller\":\"@noway\",\"body\":\"whatever\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Fri, 04 Mar 2022 11:25:00 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"25">>}],
         <<"Invalid jid: <<\"@noway\">>">>,158,859}
Params: #{body =>
              <<"{\"to\":\"bob_messages_error_handling_1788@domain.example.com\",\"caller\":\"@noway\",\"body\":\"whatever\"}">>,
          method => <<"POST">>,path => <<"/api/messages">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-04 11:25:01.341 ***
bOb_messages_error_handling_1788@domain.example.com/res1 out
</stream:stream>

*** User 2022-03-04 11:25:01.341 ***
bOb_messages_error_handling_1788@domain.example.com/res1 in
</stream:stream>

*** User 2022-03-04 11:25:01.341 ***
alicE_messages_error_handling_1788@domain.example.com/res1 out
</stream:stream>

*** User 2022-03-04 11:25:01.341 ***
alicE_messages_error_handling_1788@domain.example.com/res1 in
</stream:stream>
*** CT 2022-03-04 11:25:01.343 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_646.html
*** CT 2022-03-04 11:25:01.344 *** View log from node mongooseim@localhost when finished mongooseim@localhost_2410.html



=== Ended at 2022-03-04 11:25:01
=== successfully completed test case
=== === Returned value: ok