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

=== Config value:

    [{watchdog,<0.13879.1>},
     {{ejabberd_cwd,mongooseim@localhost},
      "/home/circleci/project/_build/mim1/rel/mongooseim"},
     {mam_backend,disabled},
     {mim_data_dir,"/home/circleci/project/big_tests/tests/rest_SUITE_data"},
     {preset,"ldap_mnesia"},
     {tc_logfile,"/home/circleci/project/big_tests/ct_report/ct_run.test@12130b74fc81.2022-03-03_10.28.39/big_tests.tests.rest_SUITE.logs/run.2022-03-03_10.38.08/rest_suite.password_can_be_changed.24964.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@12130b74fc81.2022-03-03_10.28.39/big_tests.tests.rest_SUITE.logs/run.2022-03-03_10.38.08/log_private/"},
     {escalus_users,[{alice,[{username,<<"alicE">>},
                             {server,<<"localhost">>},
                             {password,<<"matygrysa">>}]},
                     {bob,[{username,<<"bOb">>},
                           {server,<<"localhost">>},
                           {password,<<"makrolika">>}]}]}]

=== Current directory is "/home/circleci/project/big_tests/ct_report/ct_run.test@12130b74fc81.2022-03-03_10.28.39"

=== Started at 2022-03-03 10:38:08


*** CT 2022-03-03 10:38:08.241 *** View log from node mongooseim@localhost when started mongooseim@localhost_4901.html
*** CT 2022-03-03 10:38:08.241 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_2342.html

*** User 2022-03-03 10:38:08.249 ***
bOb@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-03 10:38:08.251 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='59cc770483e6e860' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-03 10:38:08.251 ***
bOb@localhost/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>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-03 10:38:08.251 ***
bOb@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



*** User 2022-03-03 10:38:08.252 ***
bOb@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-03-03 10:38:08.252 ***
bOb@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-03 10:38:08.253 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='8a0ab47cd0819d65' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-03 10:38:08.253 ***
bOb@localhost/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-03 10:38:08.253 ***
bOb@localhost/res1 out
<iq type='set' id='e76ec74212365d8521d1c79e0551c76a'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-03-03 10:38:08.253 ***
bOb@localhost/res1 in
<iq id='e76ec74212365d8521d1c79e0551c76a' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-03-03 10:38:08.254 ***
bOb@localhost/res1 out
<iq type='set' id='35f185ab269a48b1b2a15803d78c0307'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-03 10:38:08.254 ***
bOb@localhost/res1 in
<iq type='result' id='35f185ab269a48b1b2a15803d78c0307'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-03 10:38:08.254 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-03-03 10:38:08.255 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-03-03 10:38:08.255 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-03-03 10:38:08.255 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-03-03 10:38:08.258 ***
REST request:
Code: 204
Req: {<0.14063.1>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"f4124b68cffdf7fa">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,1390}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-03 10:38:08.258 ***
bOb@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-03 10:38:08.259 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='36dce75c937d855f' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-03 10:38:08.259 ***
bOb@localhost/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>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-03 10:38:08.259 ***
bOb@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBuaWVtYWtyb2xpa2E=</auth>



*** User 2022-03-03 10:38:08.260 ***
bOb@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-03-03 10:38:08.260 ***
bOb@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-03 10:38:08.261 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='d080b305f975bac3' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-03 10:38:08.261 ***
bOb@localhost/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-03 10:38:08.261 ***
bOb@localhost/res1 out
<iq type='set' id='5e7f64d49e1f7fe8a3d209a7cb81c275'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-03-03 10:38:08.261 ***
bOb@localhost/res1 in
<iq id='5e7f64d49e1f7fe8a3d209a7cb81c275' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-03-03 10:38:08.261 ***
bOb@localhost/res1 out
<iq type='set' id='2c2a802cf888d9f9c1805f3cb77c6007'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-03 10:38:08.261 ***
bOb@localhost/res1 in
<iq type='result' id='2c2a802cf888d9f9c1805f3cb77c6007'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-03 10:38:08.262 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-03-03 10:38:08.262 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-03-03 10:38:08.262 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-03-03 10:38:08.263 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-03-03 10:38:08.263 ***
bOb@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-03 10:38:08.264 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='a4ca826c611d14f1' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-03 10:38:08.264 ***
bOb@localhost/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>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-03 10:38:08.264 ***
bOb@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



*** User 2022-03-03 10:38:08.265 ***
bOb@localhost/res1 in
<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
	<not-authorized/>
</failure>


*** CT 2022-03-03 10:38:08.267 *** Stanza Log: password_can_be_changed.xml

*** User 2022-03-03 10:38:08.271 ***
REST request:
Code: 204
Req: {<0.14115.1>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"35d1c5faaae18524">>}],
      <<"{\"newpass\":\"makrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,3287}
Params: #{body => <<"{\"newpass\":\"makrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-03 10:38:08.272 ***
bOb@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-03 10:38:08.272 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='7315b838b0c0791f' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-03 10:38:08.273 ***
bOb@localhost/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>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-03 10:38:08.273 ***
bOb@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



*** User 2022-03-03 10:38:08.274 ***
bOb@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-03-03 10:38:08.274 ***
bOb@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-03 10:38:08.275 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='d9ea304a513962fb' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-03 10:38:08.275 ***
bOb@localhost/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-03 10:38:08.275 ***
bOb@localhost/res1 out
<iq type='set' id='d8943c8e1af7c4d6e7854c94e27b547a'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-03-03 10:38:08.275 ***
bOb@localhost/res1 in
<iq id='d8943c8e1af7c4d6e7854c94e27b547a' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-03-03 10:38:08.275 ***
bOb@localhost/res1 out
<iq type='set' id='a0755eef73a57ae6a01fce3aa64ad996'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-03 10:38:08.276 ***
bOb@localhost/res1 in
<iq type='result' id='a0755eef73a57ae6a01fce3aa64ad996'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-03 10:38:08.277 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-03-03 10:38:08.277 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-03-03 10:38:08.278 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-03-03 10:38:08.278 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-03-03 10:38:08.280 ***
REST request fails:
Code: 400
Req: {<0.14148.1>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"3c9c5de35b1ef7bf">>}],
      <<"{\"newpass\":\"\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"14">>}],
         <<"Empty password">>,147,735}
Params: #{body => <<"{\"newpass\":\"\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-03 10:38:08.281 ***
REST request fails:
Code: 400
Req: {<0.14153.1>,<<"/api/users/localhost/b@b">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"4381e809060c0801">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"11">>}],
         <<"Invalid JID">>,144,599}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/b@b">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}

*** CT 2022-03-03 10:38:08.283 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_2342.html
*** CT 2022-03-03 10:38:08.283 *** View log from node mongooseim@localhost when finished mongooseim@localhost_4901.html



=== Ended at 2022-03-03 10:38:08
=== successfully completed test case
=== === Returned value: ok