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

=== Config value:

    [{watchdog,<0.25535.1>},
     {{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,"pgsql_mnesia"},
     {tc_logfile,"/home/circleci/project/big_tests/ct_report/ct_run.test@7a520fcf4274.2022-02-02_15.07.36/big_tests.tests.rest_SUITE.logs/run.2022-02-02_15.14.56/rest_suite.password_can_be_changed.36485.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@7a520fcf4274.2022-02-02_15.07.36/big_tests.tests.rest_SUITE.logs/run.2022-02-02_15.14.56/log_private/"},
     {escalus_users,[{alice,[{username,<<"alicE">>},
                             {server,<<"domain.example.com">>},
                             {host,<<"localhost">>},
                             {password,<<"matygrysa">>}]},
                     {bob,[{username,<<"bOb">>},
                           {server,<<"domain.example.com">>},
                           {host,<<"localhost">>},
                           {password,<<"makrolika">>}]}]}]

=== Current directory is "/home/circleci/project/big_tests/ct_report/ct_run.test@7a520fcf4274.2022-02-02_15.07.36"

=== Started at 2022-02-02 15:14:56


*** CT 2022-02-02 15:14:56.939 *** View log from node mongooseim@localhost when started mongooseim@localhost_2326.html
*** CT 2022-02-02 15:14:56.940 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_628.html

*** User 2022-02-02 15:14:56.952 ***
bOb@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-02-02 15:14:56.955 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='67013e9ed53490f2' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-02-02 15:14:56.955 ***
bOb@domain.example.com/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-02-02 15:14:56.956 ***
bOb@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



*** User 2022-02-02 15:14:56.956 ***
bOb@domain.example.com/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-02-02 15:14:56.956 ***
bOb@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-02-02 15:14:56.957 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1a99801e6adcb5d5' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-02-02 15:14:56.957 ***
bOb@domain.example.com/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-02-02 15:14:56.957 ***
bOb@domain.example.com/res1 out
<iq type='set' id='9fd14dab0e5b25182c9cf308add26329'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-02-02 15:14:56.957 ***
bOb@domain.example.com/res1 in
<iq id='9fd14dab0e5b25182c9cf308add26329' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@domain.example.com/res1</jid>
	</bind>
</iq>



*** User 2022-02-02 15:14:56.957 ***
bOb@domain.example.com/res1 out
<iq type='set' id='2a7333421812196853c628d2971a722a'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-02-02 15:14:56.958 ***
bOb@domain.example.com/res1 in
<iq type='result' id='2a7333421812196853c628d2971a722a'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-02-02 15:14:56.958 ***
bOb@domain.example.com/res1 out
<presence/>



*** User 2022-02-02 15:14:56.960 ***
bOb@domain.example.com/res1 in
<presence from='bOb@domain.example.com/res1' to='bob@domain.example.com/res1' xml:lang='en'/>



*** User 2022-02-02 15:14:56.960 ***
bOb@domain.example.com/res1 out
</stream:stream>

*** User 2022-02-02 15:14:56.960 ***
bOb@domain.example.com/res1 in
</stream:stream>

*** User 2022-02-02 15:14:56.963 ***
REST request:
Code: 204
Req: {<0.25723.1>,<<"/api/users/domain.example.com/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"bd236f7e79897c9e">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Wed, 02 Feb 2022 15:14:56 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,2157}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/domain.example.com/bob">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-02-02 15:14:56.964 ***
bOb@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-02-02 15:14:56.965 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='4d4f68b1aee3b259' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-02-02 15:14:56.965 ***
bOb@domain.example.com/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-02-02 15:14:56.966 ***
bOb@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBuaWVtYWtyb2xpa2E=</auth>



*** User 2022-02-02 15:14:56.966 ***
bOb@domain.example.com/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-02-02 15:14:56.967 ***
bOb@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-02-02 15:14:56.967 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='c4e86c3ddf830506' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-02-02 15:14:56.967 ***
bOb@domain.example.com/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-02-02 15:14:56.967 ***
bOb@domain.example.com/res1 out
<iq type='set' id='a9fbc31923436c0a1108d1184217b150'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-02-02 15:14:56.967 ***
bOb@domain.example.com/res1 in
<iq id='a9fbc31923436c0a1108d1184217b150' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@domain.example.com/res1</jid>
	</bind>
</iq>



*** User 2022-02-02 15:14:56.967 ***
bOb@domain.example.com/res1 out
<iq type='set' id='d3092e5ee4990df54ef1dcae7f434be6'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-02-02 15:14:56.968 ***
bOb@domain.example.com/res1 in
<iq type='result' id='d3092e5ee4990df54ef1dcae7f434be6'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-02-02 15:14:56.968 ***
bOb@domain.example.com/res1 out
<presence/>



*** User 2022-02-02 15:14:56.969 ***
bOb@domain.example.com/res1 in
<presence from='bOb@domain.example.com/res1' to='bob@domain.example.com/res1' xml:lang='en'/>



*** User 2022-02-02 15:14:56.969 ***
bOb@domain.example.com/res1 out
</stream:stream>

*** User 2022-02-02 15:14:56.969 ***
bOb@domain.example.com/res1 in
</stream:stream>

*** User 2022-02-02 15:14:56.970 ***
bOb@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-02-02 15:14:56.970 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='dcdaf830f362fb90' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-02-02 15:14:56.971 ***
bOb@domain.example.com/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-02-02 15:14:56.971 ***
bOb@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



*** User 2022-02-02 15:14:56.971 ***
bOb@domain.example.com/res1 in
<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
	<not-authorized/>
</failure>


*** CT 2022-02-02 15:14:56.974 *** Stanza Log: password_can_be_changed.xml

*** User 2022-02-02 15:14:56.976 ***
REST request:
Code: 204
Req: {<0.25777.1>,<<"/api/users/domain.example.com/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"8009fcb9ffa6fdc1">>}],
      <<"{\"newpass\":\"makrolika\"}">>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Wed, 02 Feb 2022 15:14:56 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,1436}
Params: #{body => <<"{\"newpass\":\"makrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/domain.example.com/bob">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-02-02 15:14:56.977 ***
bOb@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-02-02 15:14:56.977 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1baed279f220860a' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-02-02 15:14:56.977 ***
bOb@domain.example.com/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-02-02 15:14:56.977 ***
bOb@domain.example.com/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYgBtYWtyb2xpa2E=</auth>



*** User 2022-02-02 15:14:56.978 ***
bOb@domain.example.com/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-02-02 15:14:56.978 ***
bOb@domain.example.com/res1 out
<stream:stream to='domain.example.com' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-02-02 15:14:56.978 ***
bOb@domain.example.com/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='7303db6b41ed2840' from='domain.example.com' version='1.0' xml:lang='en'>

*** User 2022-02-02 15:14:56.979 ***
bOb@domain.example.com/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-02-02 15:14:56.979 ***
bOb@domain.example.com/res1 out
<iq type='set' id='e972010c9a7eca4ef18b32587c6ef8c6'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-02-02 15:14:56.979 ***
bOb@domain.example.com/res1 in
<iq id='e972010c9a7eca4ef18b32587c6ef8c6' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb@domain.example.com/res1</jid>
	</bind>
</iq>



*** User 2022-02-02 15:14:56.979 ***
bOb@domain.example.com/res1 out
<iq type='set' id='ee480f098529c32c3f054303a354bc65'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-02-02 15:14:56.979 ***
bOb@domain.example.com/res1 in
<iq type='result' id='ee480f098529c32c3f054303a354bc65'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-02-02 15:14:56.980 ***
bOb@domain.example.com/res1 out
<presence/>



*** User 2022-02-02 15:14:56.981 ***
bOb@domain.example.com/res1 in
<presence from='bOb@domain.example.com/res1' to='bob@domain.example.com/res1' xml:lang='en'/>



*** User 2022-02-02 15:14:56.981 ***
bOb@domain.example.com/res1 out
</stream:stream>

*** User 2022-02-02 15:14:56.981 ***
bOb@domain.example.com/res1 in
</stream:stream>

*** User 2022-02-02 15:14:56.983 ***
REST request fails:
Code: 400
Req: {<0.25798.1>,<<"/api/users/domain.example.com/bob">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"26412fcf740600eb">>}],
      <<"{\"newpass\":\"\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Wed, 02 Feb 2022 15:14:56 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"14">>}],
         <<"Empty password">>,147,600}
Params: #{body => <<"{\"newpass\":\"\"}">>,method => <<"PUT">>,
          path => <<"/api/users/domain.example.com/bob">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-02-02 15:14:56.986 ***
REST request fails:
Code: 400
Req: {<0.25805.1>,<<"/api/users/domain.example.com/b@b">>,<<"PUT">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"82d6b9a7190667ab">>}],
      <<"{\"newpass\":\"niemakrolika\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Wed, 02 Feb 2022 15:14:56 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"11">>}],
         <<"Invalid JID">>,144,1611}
Params: #{body => <<"{\"newpass\":\"niemakrolika\"}">>,method => <<"PUT">>,
          path => <<"/api/users/domain.example.com/b@b">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}

*** CT 2022-02-02 15:14:56.993 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_628.html
*** CT 2022-02-02 15:14:56.994 *** View log from node mongooseim@localhost when finished mongooseim@localhost_2327.html



=== Ended at 2022-02-02 15:14:57
=== successfully completed test case
=== === Returned value: ok