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

=== Config value:

    [{watchdog,<0.12354.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@d66972e2ee88.2022-01-27_15.24.27/big_tests.tests.rest_SUITE.logs/run.2022-01-27_15.33.42/rest_suite.password_can_be_changed.32516.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@d66972e2ee88.2022-01-27_15.24.27/big_tests.tests.rest_SUITE.logs/run.2022-01-27_15.33.42/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@d66972e2ee88.2022-01-27_15.24.27"

=== Started at 2022-01-27 15:33:43


*** CT 2022-01-27 15:33:43.178 *** View log from node mongooseim@localhost when started mongooseim@localhost_4889.html
*** CT 2022-01-27 15:33:43.178 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_2322.html

*** User 2022-01-27 15:33:43.185 ***
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-01-27 15:33:43.188 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='41dca592cb63104c' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-27 15:33:43.189 ***
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-01-27 15:33:43.189 ***
bOb@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



*** User 2022-01-27 15:33:43.190 ***
bOb@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-01-27 15:33:43.190 ***
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-01-27 15:33:43.191 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='074751ac0355493c' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-27 15:33:43.191 ***
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-01-27 15:33:43.191 ***
bOb@localhost/res1 out
<iq type='set' id='7391315087ce8d85e68d32f043cbf48f'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-01-27 15:33:43.192 ***
bOb@localhost/res1 in
<iq id='7391315087ce8d85e68d32f043cbf48f' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-01-27 15:33:43.192 ***
bOb@localhost/res1 out
<iq type='set' id='566ba8697e1713052bf876d5825430f9'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-27 15:33:43.192 ***
bOb@localhost/res1 in
<iq type='result' id='566ba8697e1713052bf876d5825430f9'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-27 15:33:43.192 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-01-27 15:33:43.193 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-01-27 15:33:43.193 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-01-27 15:33:43.194 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-01-27 15:33:43.196 ***
REST request:
Code: 204
Req: {<0.12547.1>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"3324245e2fa41efd">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:33:42 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,1481}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 15:33:43.197 ***
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-01-27 15:33:43.197 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='052f46f063e2964f' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-27 15:33:43.197 ***
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-01-27 15:33:43.197 ***
bOb@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBuaWVtYWtyb2xpa2E=</auth>



*** User 2022-01-27 15:33:43.199 ***
bOb@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-01-27 15:33:43.199 ***
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-01-27 15:33:43.199 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='22825cd07a6bbdfc' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-27 15:33:43.199 ***
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-01-27 15:33:43.199 ***
bOb@localhost/res1 out
<iq type='set' id='8f6810f8e17db37f27a71ecfa33ddd9d'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-01-27 15:33:43.200 ***
bOb@localhost/res1 in
<iq id='8f6810f8e17db37f27a71ecfa33ddd9d' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-01-27 15:33:43.200 ***
bOb@localhost/res1 out
<iq type='set' id='0053779806335605cf309ee3db3979c7'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-27 15:33:43.200 ***
bOb@localhost/res1 in
<iq type='result' id='0053779806335605cf309ee3db3979c7'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-27 15:33:43.200 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-01-27 15:33:43.201 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-01-27 15:33:43.201 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-01-27 15:33:43.201 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-01-27 15:33:43.202 ***
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-01-27 15:33:43.203 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='9507556fff681092' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-27 15:33:43.203 ***
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-01-27 15:33:43.203 ***
bOb@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



*** User 2022-01-27 15:33:43.204 ***
bOb@localhost/res1 in
<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
	<not-authorized/>
</failure>


*** CT 2022-01-27 15:33:43.206 *** Stanza Log: password_can_be_changed.xml

*** User 2022-01-27 15:33:43.208 ***
REST request:
Code: 204
Req: {<0.12599.1>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"3e9d8c505ace8a95">>}],
      <<"{\"newpass\":\"makrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:33:42 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,1313}
Params: #{body => <<"{\"newpass\":\"makrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 15:33:43.209 ***
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-01-27 15:33:43.209 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='6516d2b232227053' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-27 15:33:43.209 ***
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-01-27 15:33:43.209 ***
bOb@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



*** User 2022-01-27 15:33:43.210 ***
bOb@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-01-27 15:33:43.210 ***
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-01-27 15:33:43.211 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3e25c0f5ca33b82e' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-27 15:33:43.211 ***
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-01-27 15:33:43.211 ***
bOb@localhost/res1 out
<iq type='set' id='5711d4ad24cb0f7b6cd63c78171f4f09'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-01-27 15:33:43.211 ***
bOb@localhost/res1 in
<iq id='5711d4ad24cb0f7b6cd63c78171f4f09' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-01-27 15:33:43.211 ***
bOb@localhost/res1 out
<iq type='set' id='a324875c09bae98f9286e78bf0eb863f'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-27 15:33:43.213 ***
bOb@localhost/res1 in
<iq type='result' id='a324875c09bae98f9286e78bf0eb863f'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-27 15:33:43.213 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-01-27 15:33:43.213 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-01-27 15:33:43.214 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-01-27 15:33:43.214 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-01-27 15:33:43.216 ***
REST request fails:
Code: 400
Req: {<0.12621.1>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"fac3ccc812c5f219">>}],
      <<"{\"newpass\":\"\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:33:42 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"14">>}],
         <<"Empty password">>,147,860}
Params: #{body => <<"{\"newpass\":\"\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 15:33:43.217 ***
REST request fails:
Code: 400
Req: {<0.12627.1>,<<"/api/users/localhost/b@b">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"b8e12aa18e443c42">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:33:42 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"11">>}],
         <<"Invalid JID">>,144,819}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/b@b">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}

*** CT 2022-01-27 15:33:43.219 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_2322.html
*** CT 2022-01-27 15:33:43.219 *** View log from node mongooseim@localhost when finished mongooseim@localhost_4889.html



=== Ended at 2022-01-27 15:33:43
=== successfully completed test case
=== === Returned value: ok