Tsung负载测试XMPP与TLS

时间:2014-05-12 20:58:05

标签: xmpp load-testing ejabberd tsung

有没有人有一个带有TLS实现的xml tsung配置文件?我想在我的XMPP服务器上测试TLS安全连接,但是我无法在启用TLS的情况下运行该脚本。

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/Users/Downloads/tsung-1-5-0/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
  <clients>
   <client host="localhost" use_controller_vm="true" maxusers="600"/>
  </clients>

  <!-- Server side setup -->
 <servers>
  <server host="chat.example.com" port="5222" type="tcp"></server>
 </servers>

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

  <!-- JABBER parameters -->
  <!-- to synchronise users,  use a global acknoledgement -->
 <options>
  <option type="ts_jabber" name="global_number" value="1000"></option>
  <option type="ts_jabber" name="userid_max" value="10000"></option>
  <option type="ts_jabber" name="domain" value="chat.example.com"></option>
  <option type="ts_jabber" name="username" value="tsunguser"></option>
  <option type="ts_jabber" name="passwd" value="tsunguser"></option>
 </options>

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

    <request> <jabber type="starttls" ack="local" cacertfile="%%_cacert%%" certfile="%%_certfile%%" keyfile="%%_keyfile%%" /></request>
    <thinktime value="2"></thinktime>
    <transaction name="authenticate">
      <request> <jabber type="auth_get" ack="local"></jabber> </request>
      <request> <jabber type="auth_set_plain" ack="local"></jabber> </request>
    </transaction>

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

    <transaction name="roster">
      <request> <jabber type="iq:roster:get" ack="local"></jabber></request>
    </transaction>

    <thinktime value="30"></thinktime>

    <transaction name="online">
    <request> <jabber type="chat" ack="no_ack" size="16" destination="online"></jabber> </request>
    </transaction>

    <thinktime value="30"></thinktime>

    <transaction name="offline">
      <request> <jabber type="chat" ack="no_ack" size="56" destination="offline"></jabber> </request>
    </transaction>

    <thinktime value="30"></thinktime>

    <transaction name="close">
      <request> <jabber type="close" ack="no_ack"></jabber> </request>
    </transaction>

  </session>

  <session probability="20" name="jabber-digest" type="ts_jabber">

    <!-- regexp captures stream ID returned by server -->
    <request>
      <dyn_variable name="sid" re="&lt;stream:stream id=&quot;(.*)&quot; xmlns:stream"/>
      <jabber type="connect" ack="local"></jabber>
    </request>

    <thinktime value="2"></thinktime>

    <transaction name="auth_digest">
      <request> <jabber type="auth_get" ack="local"></jabber> </request>
      <request subst='true'> <jabber type="auth_set_digest" ack="local"></jabber> </request>
    </transaction>
    <thinktime value="30"></thinktime>

    <transaction name="close">
      <request> <jabber type="close" ack="no_ack"></jabber> </request>
    </transaction>
  </session>


 </sessions>
</tsung>

这是我执行xml时的错误日志。当我删除TLS Part everthing工作时。

594- fatal: {failed_validation,
                {element_seq_not_conform,{wait,session},{is,jabber}}}
Config Error, aborting ! {fatal,
                             {{failed_validation,
                                  {element_seq_not_conform,
                                      {wait,session},
                                      {is,jabber}}},
                              {file,"jabber.xml"},
                              {line,112},
                              {col,1}}}

2 个答案:

答案 0 :(得分:0)

将以下交易值用于与TLS“连接”

<transaction name="connect">
  <request> <jabber type="connect" ack="local"/> </request>
  <request> <jabber type="starttls" ack="bidi_ack"/> </request>
  <request> <jabber type="connect" ack="local"/> </request>
</transaction>

此外,您还必须添加如下所示的选项值,

<options>
 <option name="ssl_reuse_sessions" value="false"/>
 <option name="ssl_versions" value="'tlsv1.2'"/>
</options>

请与服务器团队交叉检查TLS版本。

如果您有任何疑问,请告诉我。

答案 1 :(得分:-1)

你是否成功在没有TLS的情况下运行它?