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

=== Config value:

    [{watchdog,<0.8353.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@43a5deef6262.2022-01-27_15.25.11/big_tests.tests.rest_SUITE.logs/run.2022-01-27_15.36.47/rest_suite.password_can_be_changed.147458.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@43a5deef6262.2022-01-27_15.25.11/big_tests.tests.rest_SUITE.logs/run.2022-01-27_15.36.47/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@43a5deef6262.2022-01-27_15.25.11"

=== Started at 2022-01-27 15:36:47


*** CT 2022-01-27 15:36:47.955 *** View log from node mongooseim@localhost when started mongooseim@localhost_5699.html
*** CT 2022-01-27 15:36:47.955 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_2385.html

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

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



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



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

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



*** User 2022-01-27 15:36:47.974 ***
bOb@localhost/res1 in
<iq id='4d666d4e372f6f4d73af1f887b4fc004' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



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



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



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



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



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

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

*** User 2022-01-27 15:36:47.993 ***
REST request:
Code: 204
Req: {<0.8555.2>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"1aac01d558237f49">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:36:47 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,3121}
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:36:47.994 ***
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:36:47.994 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='90c923f8af6e8697' from='localhost' version='1.0' xml:lang='en'>

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



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



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

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



*** User 2022-01-27 15:36:47.997 ***
bOb@localhost/res1 in
<iq id='75bbde6a9bdb964d6d222f1c7937c5a4' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



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



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



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



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



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

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

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

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



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


*** CT 2022-01-27 15:36:48.048 *** Stanza Log: password_can_be_changed.xml

*** User 2022-01-27 15:36:48.054 ***
REST request:
Code: 204
Req: {<0.8590.2>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"fc9a961e48cf735b">>}],
      <<"{\"newpass\":\"makrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:36:48 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,3897}
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:36:48.055 ***
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:36:48.055 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3579c2357a421e0c' from='localhost' version='1.0' xml:lang='en'>

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



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



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

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



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



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



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



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



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



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

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

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


*** User 2022-01-27 15:36:48.067 ***
REST request fails:
Code: 400
Req: {<0.8616.2>,<<"/api/users/localhost/b@b">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"1a483745a2a8b9ee">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:36:48 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"11">>}],
         <<"Invalid JID">>,144,776}
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:36:48.070 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_2385.html
*** CT 2022-01-27 15:36:48.071 *** View log from node mongooseim@localhost when finished mongooseim@localhost_5699.html



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