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

=== Config value:

    [{watchdog,<0.24874.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@998557c7e1d1.2022-01-27_12.27.57/big_tests.tests.rest_SUITE.logs/run.2022-01-27_12.36.31/rest_suite.stanzas_are_sent_and_received.61316.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@998557c7e1d1.2022-01-27_12.27.57/big_tests.tests.rest_SUITE.logs/run.2022-01-27_12.36.31/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@998557c7e1d1.2022-01-27_12.27.57"

=== Started at 2022-01-27 12:36:31


*** CT 2022-01-27 12:36:31.269 *** View log from node mongooseim@localhost when started mongooseim@localhost_2363.html
*** CT 2022-01-27 12:36:31.270 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_655.html

*** User 2022-01-27 12:36:31.335 ***
alicE_stanzas_are_sent_and_received_1730@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-01-27 12:36:31.336 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='5118022eb99ef1d6' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-01-27 12:36:31.336 ***
alicE_stanzas_are_sent_and_received_1730@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-01-27 12:36:31.336 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFsaWNFX3N0YW56YXNfYXJlX3NlbnRfYW5kX3JlY2VpdmVkXzE3MzAAbWF0eWdyeXNh</auth>



*** User 2022-01-27 12:36:31.339 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-01-27 12:36:31.339 ***
alicE_stanzas_are_sent_and_received_1730@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-01-27 12:36:31.339 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='8e0187ca0efd27a2' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-01-27 12:36:31.339 ***
alicE_stanzas_are_sent_and_received_1730@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-01-27 12:36:31.339 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 out
<iq type='set' id='0c13631d5a1f2a113b931158a0bdd498'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-01-27 12:36:31.340 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<iq id='0c13631d5a1f2a113b931158a0bdd498' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1</jid>
	</bind>
</iq>



*** User 2022-01-27 12:36:31.340 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 out
<iq type='set' id='b8adc17fa5fc9875e05db325a2d91bde'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-27 12:36:31.341 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<iq type='result' id='b8adc17fa5fc9875e05db325a2d91bde'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-27 12:36:31.341 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 out
<presence/>



*** User 2022-01-27 12:36:31.344 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<presence from='alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1' to='alice_stanzas_are_sent_and_received_1730@domain.example.com/res1' xml:lang='en'/>



*** User 2022-01-27 12:36:31.346 ***
bOb_stanzas_are_sent_and_received_1730@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-01-27 12:36:31.348 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='cb333a05efb00523' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-01-27 12:36:31.348 ***
bOb_stanzas_are_sent_and_received_1730@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-01-27 12:36:31.348 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYl9zdGFuemFzX2FyZV9zZW50X2FuZF9yZWNlaXZlZF8xNzMwAG1ha3JvbGlrYQ==</auth>



*** User 2022-01-27 12:36:31.353 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-01-27 12:36:31.353 ***
bOb_stanzas_are_sent_and_received_1730@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-01-27 12:36:31.354 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='725e1cc5269b8e10' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-01-27 12:36:31.354 ***
bOb_stanzas_are_sent_and_received_1730@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-01-27 12:36:31.355 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 out
<iq type='set' id='853e40250958e02f67eeb1ff3364bde2'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-01-27 12:36:31.355 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<iq id='853e40250958e02f67eeb1ff3364bde2' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1</jid>
	</bind>
</iq>



*** User 2022-01-27 12:36:31.355 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 out
<iq type='set' id='622dd14b3dffb919d5569fc800f96890'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-27 12:36:31.356 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<iq type='result' id='622dd14b3dffb919d5569fc800f96890'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-27 12:36:31.356 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 out
<presence/>



*** User 2022-01-27 12:36:31.364 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<presence from='bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1' to='bob_stanzas_are_sent_and_received_1730@domain.example.com/res1' xml:lang='en'/>



*** User 2022-01-27 12:36:31.465 ***
REST request:
Code: 204
Req: {<0.25107.1>,<<"/api/stanzas">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"dc7ad10c9ea0560c">>}],
      <<"{\"stanza\":\"the bodyinside the sibling\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 12:36:31 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,98774}
Params: #{body =>
              <<"{\"stanza\":\"the bodyinside the sibling\"}">>,
          method => <<"POST">>,path => <<"/api/stanzas">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 12:36:31.465 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
<message from='alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1' to='bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1' extra='attribute'>
	<body>the body</body>
	<sibling>inside the sibling</sibling>
	<stanza-id by='bOb_stanzas_are_sent_and_received_1730@domain.example.com' id='BLKFI5HP2N01' xmlns='urn:xmpp:sid:0'/>
</message>



*** User 2022-01-27 12:36:31.465 ***
M: {xmlel,<<"message">>,
          [{<<"from">>,
            <<"alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1">>},
           {<<"extra">>,<<"attribute">>}],
          [{xmlel,<<"body">>,[],[{xmlcdata,<<"the body">>}]},
           {xmlel,<<"sibling">>,[],[{xmlcdata,<<"inside the sibling">>}]}]}

*** User 2022-01-27 12:36:31.470 ***
REST request fails:
Code: 400
Req: {<0.25147.1>,<<"/api/stanzas">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"defa236ed296f44b">>}],
      <<"{\"stanza\":\"the bodyinside the sibling\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 12:36:31 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"29">>}],
         <<"both from and to are required">>,162,835}
Params: #{body =>
              <<"{\"stanza\":\"the bodyinside the sibling\"}">>,
          method => <<"POST">>,path => <<"/api/stanzas">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 12:36:31.472 ***
REST request fails:
Code: 400
Req: {<0.25149.1>,<<"/api/stanzas">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"4d146d1f1055d2f7">>}],
      <<"{\"stanza\":\"the body>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 12:36:31 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"30">>}],
         <<"Malformed stanza: \"expected >\"">>,163,834}
Params: #{body =>
              <<"{\"stanza\":\"the body>,
          method => <<"POST">>,path => <<"/api/stanzas">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 12:36:31.472 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 out
</stream:stream>

*** User 2022-01-27 12:36:31.473 ***
bOb_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
</stream:stream>

*** User 2022-01-27 12:36:31.474 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 out
</stream:stream>

*** User 2022-01-27 12:36:31.475 ***
alicE_stanzas_are_sent_and_received_1730@domain.example.com/res1 in
</stream:stream>
*** CT 2022-01-27 12:36:31.477 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_655.html
*** CT 2022-01-27 12:36:31.478 *** View log from node mongooseim@localhost when finished mongooseim@localhost_2363.html



=== Ended at 2022-01-27 12:36:31
=== successfully completed test case
=== === Returned value: ok