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

=== Config value:

    [{watchdog,<0.12333.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@cb94372a8ea7.2022-04-04_15.02.36/big_tests.tests.rest_SUITE.logs/run.2022-04-04_15.15.00/rest_suite.password_can_be_changed.178050.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@cb94372a8ea7.2022-04-04_15.02.36/big_tests.tests.rest_SUITE.logs/run.2022-04-04_15.15.00/log_private/"},
     {{saved_modules,mongooseim@localhost,<<"localhost">>},
      #{mod_adhoc => #{iqdisc => one_queue,report_commands_node => false},
        mod_amp => [],
        mod_bosh =>
            #{backend => mnesia,inactivity => 30,max_pause => 120,
              max_wait => infinity,server_acks => false},
        mod_cache_users =>
            #{number_of_segments => 5,strategy => fifo,time_to_live => 2},
        mod_carboncopy => [],mod_commands => [],
        mod_disco =>
            #{extra_domains => [],iqdisc => one_queue,server_info => [],
              users_can_see_hidden_services => false},
        mod_muc_commands => [],mod_muc_light_commands => [],
        mod_register =>
            [{access,register},
             {ip_access,[{allow,"127.0.0.0/8"},{deny,"0.0.0.0/0"}]},
             {welcome_message,{[],[]}}],
        mod_roster =>
            #{backend => rdbms,iqdisc => one_queue,store_current_id => false,
              versioning => false},
        mod_sic => #{iqdisc => one_queue},
        mod_stream_management =>
            #{ack => true,ack_freq => 1,backend => mnesia,buffer => true,
              buffer_max => 100,resume_timeout => 600,
              stale_h =>
                  #{enabled => false,geriatric => 3600,repeat_after => 1800}},
        mod_vcard =>
            #{backend => rdbms,
              host => {prefix,<<"vjud.">>},
              iqdisc => parallel,matches => 30,search => true}}},
     {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@cb94372a8ea7.2022-04-04_15.02.36"

=== Started at 2022-04-04 15:15:00


*** CT 2022-04-04 15:15:00.413 *** View log from node mongooseim@localhost when started mongooseim@localhost_4991.html
*** CT 2022-04-04 15:15:00.413 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_1974.html

*** User 2022-04-04 15:15:00.433 ***
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-04-04 15:15:00.434 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3810bdd59f40c6d3' from='localhost' version='1.0' xml:lang='en'>

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



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



*** User 2022-04-04 15:15:00.436 ***
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-04-04 15:15:00.437 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='77aa3aa7e5ec4a6e' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-04-04 15:15:00.437 ***
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-04-04 15:15:00.439 ***
bOb@localhost/res1 out
<iq type='set' id='e0735941d8a1bfd81c62afd38e1cc35b'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-04-04 15:15:00.440 ***
bOb@localhost/res1 in
<iq id='e0735941d8a1bfd81c62afd38e1cc35b' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-04-04 15:15:00.440 ***
bOb@localhost/res1 out
<iq type='set' id='d080dc1af85fb5d2d978e6ae68975cd1'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-04-04 15:15:00.441 ***
bOb@localhost/res1 in
<iq type='result' id='d080dc1af85fb5d2d978e6ae68975cd1'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-04-04 15:15:00.441 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-04-04 15:15:00.445 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-04-04 15:15:00.446 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-04-04 15:15:00.447 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-04-04 15:15:00.456 ***
REST request:
Code: 204
Req: {<0.12517.2>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"35cf223d77707c2e">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Mon, 04 Apr 2022 15:15:00 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,7333}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


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

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



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



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

*** User 2022-04-04 15:15:00.461 ***
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-04-04 15:15:00.461 ***
bOb@localhost/res1 out
<iq type='set' id='6423459160c954a653ecd02ac9794ba7'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-04-04 15:15:00.461 ***
bOb@localhost/res1 in
<iq id='6423459160c954a653ecd02ac9794ba7' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-04-04 15:15:00.462 ***
bOb@localhost/res1 out
<iq type='set' id='0c2dc01f4926a7ab70533038520a2986'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-04-04 15:15:00.462 ***
bOb@localhost/res1 in
<iq type='result' id='0c2dc01f4926a7ab70533038520a2986'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-04-04 15:15:00.462 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-04-04 15:15:00.469 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-04-04 15:15:00.469 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-04-04 15:15:00.469 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-04-04 15:15:00.471 ***
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-04-04 15:15:00.474 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3689d0b1df8679d9' from='localhost' version='1.0' xml:lang='en'>

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



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


*** CT 2022-04-04 15:15:00.539 *** Stanza Log: password_can_be_changed.xml

*** User 2022-04-04 15:15:00.544 ***
REST request:
Code: 204
Req: {<0.12586.2>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"17ceb9615c317821">>}],
      <<"{\"newpass\":\"makrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Mon, 04 Apr 2022 15:15:00 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,2785}
Params: #{body => <<"{\"newpass\":\"makrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


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

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



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



*** User 2022-04-04 15:15:00.547 ***
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-04-04 15:15:00.548 ***
bOb@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='0760d3218277456f' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-04-04 15:15:00.548 ***
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-04-04 15:15:00.548 ***
bOb@localhost/res1 out
<iq type='set' id='78df2edb0852cebe6f46cf079a16cb64'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-04-04 15:15:00.548 ***
bOb@localhost/res1 in
<iq id='78df2edb0852cebe6f46cf079a16cb64' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-04-04 15:15:00.548 ***
bOb@localhost/res1 out
<iq type='set' id='d160c7675c8fa8a23d47b01402c6ef57'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-04-04 15:15:00.549 ***
bOb@localhost/res1 in
<iq type='result' id='d160c7675c8fa8a23d47b01402c6ef57'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-04-04 15:15:00.549 ***
bOb@localhost/res1 out
<presence/>



*** User 2022-04-04 15:15:00.552 ***
bOb@localhost/res1 in
<presence from='bOb@localhost/res1' to='bob@localhost/res1' xml:lang='en'/>



*** User 2022-04-04 15:15:00.552 ***
bOb@localhost/res1 out
</stream:stream>

*** User 2022-04-04 15:15:00.553 ***
bOb@localhost/res1 in
</stream:stream>

*** User 2022-04-04 15:15:00.554 ***
REST request fails:
Code: 400
Req: {<0.12594.2>,<<"/api/users/localhost/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"e3a0e82751882643">>}],
      <<"{\"newpass\":\"\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Mon, 04 Apr 2022 15:15:00 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"14">>}],
         <<"Empty password">>,147,729}
Params: #{body => <<"{\"newpass\":\"\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/bob">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-04-04 15:15:00.557 ***
REST request fails:
Code: 400
Req: {<0.12596.2>,<<"/api/users/localhost/b@b">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"e1197193cfeb6058">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Mon, 04 Apr 2022 15:15:00 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"11">>}],
         <<"Invalid JID">>,144,1012}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/localhost/b@b">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}

*** CT 2022-04-04 15:15:00.560 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_1974.html
*** CT 2022-04-04 15:15:00.561 *** View log from node mongooseim@localhost when finished mongooseim@localhost_4991.html



=== Ended at 2022-04-04 15:15:00
=== successfully completed test case
=== === Returned value: ok