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

=== Config value:

    [{watchdog,<0.7719.2>},
     {{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@ebe8a8f9fc53.2022-01-25_16.21.59/big_tests.tests.rest_SUITE.logs/run.2022-01-25_16.34.19/rest_suite.password_can_be_changed.38661.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@ebe8a8f9fc53.2022-01-25_16.21.59/big_tests.tests.rest_SUITE.logs/run.2022-01-25_16.34.19/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@ebe8a8f9fc53.2022-01-25_16.21.59"

=== Started at 2022-01-25 16:34:20


*** CT 2022-01-25 16:34:20.058 *** View log from node mongooseim@localhost when started mongooseim@localhost_5708.html
*** CT 2022-01-25 16:34:20.059 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_2377.html

*** User 2022-01-25 16:34:20.073 ***
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-25 16:34:20.076 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='a5f4e7e6ff81620c' from='localhost' version='1.0' xml:lang='en'>

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



*** User 2022-01-25 16:34:20.078 ***
bOb@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-01-25 16:34:20.078 ***
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-25 16:34:20.078 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='f0f530e776643037' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-25 16:34:20.079 ***
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-25 16:34:20.079 ***
bOb@localhost/res1 out
<iq type='set' id='442fabc5f9ecd047c1efb48660acf0e8'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-01-25 16:34:20.079 ***
bOb@localhost/res1 in
<iq id='442fabc5f9ecd047c1efb48660acf0e8' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-01-25 16:34:20.079 ***
bOb@localhost/res1 out
<iq type='set' id='5c25fdc9a0e8abc98b2df72b11c8edcf'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-25 16:34:20.079 ***
bOb@localhost/res1 in
<iq type='result' id='5c25fdc9a0e8abc98b2df72b11c8edcf'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-25 16:34:20.080 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-01-25 16:34:20.082 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-01-25 16:34:20.082 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-01-25 16:34:20.082 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-01-25 16:34:20.086 ***
REST request:
Code: 204
Req: {<0.7905.2>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"c76f0d18a8e74df2">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,2229}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.087 ***
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-25 16:34:20.087 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='471cceb9e0ab1f69' from='localhost' version='1.0' xml:lang='en'>

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



*** User 2022-01-25 16:34:20.129 ***
bOb@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-01-25 16:34:20.129 ***
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-25 16:34:20.130 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='e3c2a7b17445f9a0' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-25 16:34:20.130 ***
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-25 16:34:20.130 ***
bOb@localhost/res1 out
<iq type='set' id='9aba4d3522ecdcc322340378811e29fc'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-01-25 16:34:20.130 ***
bOb@localhost/res1 in
<iq id='9aba4d3522ecdcc322340378811e29fc' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-01-25 16:34:20.131 ***
bOb@localhost/res1 out
<iq type='set' id='a2e5bddbda321c8552d78d56900b3ee1'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-25 16:34:20.131 ***
bOb@localhost/res1 in
<iq type='result' id='a2e5bddbda321c8552d78d56900b3ee1'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-25 16:34:20.131 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-01-25 16:34:20.134 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-01-25 16:34:20.134 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-01-25 16:34:20.134 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-01-25 16:34:20.135 ***
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-25 16:34:20.135 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='bcfb691361bc6e65' from='localhost' version='1.0' xml:lang='en'>

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



*** User 2022-01-25 16:34:20.137 ***
bOb@localhost/res1 in
<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
	<not-authorized/>
</failure>


*** CT 2022-01-25 16:34:20.140 *** Stanza Log: password_can_be_changed.xml

*** User 2022-01-25 16:34:20.144 ***
REST request:
Code: 204
Req: {<0.7953.2>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"8bc7837d7a6cc8ce">>}],
      <<"{\"newpass\":\"makrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,2597}
Params: #{body => <<"{\"newpass\":\"makrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.144 ***
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-25 16:34:20.145 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='7e5dd84d9c1259b5' from='localhost' version='1.0' xml:lang='en'>

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



*** User 2022-01-25 16:34:20.148 ***
bOb@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-01-25 16:34:20.148 ***
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-25 16:34:20.149 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='a1b87513faa3e71a' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-25 16:34:20.149 ***
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-25 16:34:20.149 ***
bOb@localhost/res1 out
<iq type='set' id='a91a7cee6f9c53ede9e56ac62d7d0eea'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-01-25 16:34:20.149 ***
bOb@localhost/res1 in
<iq id='a91a7cee6f9c53ede9e56ac62d7d0eea' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-01-25 16:34:20.149 ***
bOb@localhost/res1 out
<iq type='set' id='0deeff684450d7615a44c3f7dc5f963d'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-25 16:34:20.150 ***
bOb@localhost/res1 in
<iq type='result' id='0deeff684450d7615a44c3f7dc5f963d'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-25 16:34:20.150 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-01-25 16:34:20.152 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-01-25 16:34:20.152 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-01-25 16:34:20.153 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-01-25 16:34:20.155 ***
REST request fails:
Code: 400
Req: {<0.7980.2>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"b48ed08af301e8d4">>}],
      <<"{\"newpass\":\"\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"14">>}],
         <<"empty password">>,147,631}
Params: #{body => <<"{\"newpass\":\"\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.156 ***
REST request fails:
Code: 400
Req: {<0.7982.2>,<<"/api/users/localhost/b@b">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"5f82ac672b8248b5">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"11">>}],
         <<"invalid jid">>,144,569}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/b@b">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}

*** CT 2022-01-25 16:34:20.158 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_2377.html
*** CT 2022-01-25 16:34:20.159 *** View log from node mongooseim@localhost when finished mongooseim@localhost_5708.html



=== Ended at 2022-01-25 16:34:20
=== successfully completed test case
=== === Returned value: ok