Tsung使用xmpp身份验证

时间:2014-01-09 13:27:32

标签: ejabberd tsung

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">

  <clients>
     <client host="localhost" use_controller_vm="true"></client>
  </clients>
  <servers>
   <server host="localhost" port="5222" type="tcp"></server>
  </servers>

<load>
    <arrivalphase phase="1" duration="1" unit="minute">
     <users maxnumber="100" interarrival="5" unit="second"></users>
    </arrivalphase>
   </load>
<options>
   <option type="ts_jabber" name="global_number" value="100"></option>
   <option type="ts_jabber" name="userid_max" value="100"></option>
   <option type="ts_jabber" name="domain" value="localhost"></option>
   <option type="ts_jabber" name="username" value="ram"></option>
   <option type="ts_jabber" name="passwd" value="ram123"></option>
  </options>

<sessions> 
<session probability="100" name="jabber-example" type="ts_jabber">

 <request> <jabber type="connect" ack="no_ack"></jabber> </request>
    <thinktime value="2"></thinktime>

 <transaction name="authenticate">
    <request> <jabber type="auth_get" ack="global"></jabber></request>
    <request> <jabber type="auth_set_plain" ack="local"></jabber></request>
</transaction>

    <request>
      <jabber type="presence:initial" ack="no_ack"></jabber></request>
    <thinktime value="100"></thinktime>

<transaction name="close">
    <request> <jabber type="close" ack="local"></jabber></request>
</transaction>
  </session>
 </sessions>
</tsung>
</tsung>

这是我的tsung.xml文件代码,启动后我获得了ejabberd.log中的日志文件:

I(<0.425.0>:ejabberd_listener:281) : (#Port<0.4419>) Accepted connection {{192,168,1,583},47237} -> {{192,168,1,583},5222}

=INFO REPORT==== 2014-01-09 18:51:41 ===
I(<0.425.0>:ejabberd_listener:281) : (#Port<0.4421>) Accepted connection {{192,168,1,583},42575} -> {{192,168,1,583},5222}

=INFO REPORT==== 2014-01-09 18:51:50 ===
I(<0.425.0>:ejabberd_listener:281) : (#Port<0.4423>) Accepted connection {{192,168,1,583},50031} -> {{192,168,1,583},5222}

=INFO REPORT==== 2014-01-09 18:52:01 ===
I(<0.425.0>:ejabberd_listener:281) : (#Port<0.4425>) Accepted connection {{192,168,1,583},51034} -> {{192,168,1,583},5222}

但我不能在日志文件中获取我的外部身份验证用户名。

1 个答案:

答案 0 :(得分:4)

我遇到了同样的情况,您应该在tsung.xml中更改以下代码。 将auth_get更改为auth_sasl

<transaction name="authenticate">
    <request> <jabber type="auth_get" ack="global"></jabber></request>
    <request> <jabber type="auth_set_plain" ack="local"></jabber></request>
</transaction>

我的配置文件如下。我得到了帮助 Tsung connected users are not shownhttp://tsung.erlang-projects.org/user_manual/conf-sessions.html 6.6.3.3。 SASL平原。祝你好运!

<!DOCTYPE tsung SYSTEM "/usr/local/tsung/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
<clients>
    <client host="localhost" use_controller_vm="true"></client>
</clients>

<!-- Server side setup -->
<servers>
    <server host="192.168.133.111" port="5222" type="tcp"></server>
</servers>

<load>
    <arrivalphase phase="1" duration="2" unit="minute">
    <users interarrival="2" unit="second"></users>
</arrivalphase>
</load>

<options>
    <option type="ts_jabber" name="global_number" value="100"></option>
    <option type="ts_jabber" name="userid_max" value="100"></option>
    <option type="ts_jabber" name="domain" value="192.168.133.111"></option>
    <option type="ts_jabber" name="username" value="user"></option>
    <option type="ts_jabber" name="passwd" value="pass"></option>
</options>
<sessions>
    <session probability="100" name="jabber-example" type="ts_jabber">
    <request> <jabber type="connect" ack="local"></jabber> </request>
    <thinktime value="2"></thinktime>
    <transaction name="authenticate">
        <request> <jabber type="auth_sasl" ack="local"></jabber> </request>
        <request> <jabber type="connect" ack="local"></jabber> </request>
        <request> <jabber type="auth_sasl_bind" ack="local" ></jabber></request>
        <request> <jabber type="auth_sasl_session" ack="local" ></jabber></request>
    </transaction>
    <thinktime value="30"></thinktime>
    <transaction name="close">
        <request> <jabber type="close" ack="local"></jabber> </request>
    </transaction>
    </session>
</sessions>
</tsung>