=== Test case: rest_SUITE:password_can_be_changed/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.password_can_be_changed.150274.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.259 *** View log from node mongooseim@localhost when started mongooseim@localhost_2410.html
*** CT 2022-03-04 11:25:01.259 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_646.html

*** User 2022-03-04 11:25:01.271 ***
bOb@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.273 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='42970c492b4140d9' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.273 ***
bOb@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.273 ***
bOb@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



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



*** User 2022-03-04 11:25:01.276 ***
bOb@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.276 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='0ac0db0bc625036f' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.277 ***
bOb@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.277 ***
bOb@domain.example.com/res1 out
<iq type='set' id='4f7dab2a1c889b97ab038227ab1b3697'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



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



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



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



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



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



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

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

*** User 2022-03-04 11:25:01.283 ***
REST request:
Code: 204
Req: {<0.27296.1>,<<"/api/users/domain.example.com/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"17b499e70daf7d4a">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Fri, 04 Mar 2022 11:25:00 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,1891}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/domain.example.com/bob">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-04 11:25:01.284 ***
bOb@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 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='173a88207d3d0d07' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.284 ***
bOb@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.284 ***
bOb@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBuaWVtYWtyb2xpa2E=</auth>



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



*** User 2022-03-04 11:25:01.285 ***
bOb@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.285 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='8daa0fc52b327dc8' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.286 ***
bOb@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.286 ***
bOb@domain.example.com/res1 out
<iq type='set' id='2bde89d9defbda47d51959385644e308'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



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



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



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



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



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



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

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

*** User 2022-03-04 11:25:01.288 ***
bOb@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@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3a05444dfd0c9d99' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.289 ***
bOb@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.289 ***
bOb@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



*** User 2022-03-04 11:25:01.291 ***
bOb@domain.example.com/res1 in
<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
	<not-authorized/>
</failure>


*** CT 2022-03-04 11:25:01.292 *** Stanza Log: password_can_be_changed.xml

*** User 2022-03-04 11:25:01.297 ***
REST request:
Code: 204
Req: {<0.27327.1>,<<"/api/users/domain.example.com/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"35a4a8fd77675aa7">>}],
      <<"{\"newpass\":\"makrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Fri, 04 Mar 2022 11:25:00 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,4096}
Params: #{body => <<"{\"newpass\":\"makrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/domain.example.com/bob">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-04 11:25:01.339 ***
bOb@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.339 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='ab80b5041e15126d' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.339 ***
bOb@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.339 ***
bOb@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



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



*** User 2022-03-04 11:25:01.341 ***
bOb@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.342 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='a9773afe5bcbdff1' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:25:01.342 ***
bOb@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.342 ***
bOb@domain.example.com/res1 out
<iq type='set' id='e524636ed4ebc8b351357a7c2b5af43e'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



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



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



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



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



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



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

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

*** User 2022-03-04 11:25:01.346 ***
REST request fails:
Code: 400
Req: {<0.27356.1>,<<"/api/users/domain.example.com/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"3d15b1d0e553ba56">>}],
      <<"{\"newpass\":\"\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Fri, 04 Mar 2022 11:25:00 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"14">>}],
         <<"Empty password">>,147,691}
Params: #{body => <<"{\"newpass\":\"\"}">>,method => <<"PUT">>,
          path => <<"/api/users/domain.example.com/bob">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-04 11:25:01.348 ***
REST request fails:
Code: 400
Req: {<0.27362.1>,<<"/api/users/domain.example.com/b@b">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"7c18706860ce8785">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Fri, 04 Mar 2022 11:25:00 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"11">>}],
         <<"Invalid JID">>,144,930}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/domain.example.com/b@b">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}

*** CT 2022-03-04 11:25:01.352 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_646.html
*** CT 2022-03-04 11:25:01.353 *** 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