bobbywebz
bobbywebz

Reputation: 63

Tsung Load-Test XMPP with TLS

Does anyone have an xml tsung configuration file with TLS implementation? I want to test TLS Secured connections on my XMPP server, but I can't get the script running with TLS enabled.

<?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>

This is the Error Log when i execute the xml. When i remove the TLS Part everthing works.

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}}}

Upvotes: 2

Views: 2598

Answers (3)

Manda Yugana
Manda Yugana

Reputation: 11

element_seq_not_conform error is probably Tsung complaining about elements sequence. Try to validate the XML against tsung-1.0.dtd to get a hint.

I got similar error yesterday. After validating the XML, I got following error.

The content of element type "tsung" must match "(information?,clients,servers,monitoring?,load,options?,sessions)".

All required child elements (<clients>, <servers>, <load>, and <sessions>) were there in <tsung> element.

<tsung>
  <clients>...</clients>
  <servers>...</servers>
  <monitoring>...</monitoring>
  <options>...</options>
  <load>...</load>
  <sessions>...</sessions>
</tsung>

It looked like Tsung wants the child elements in the correct order. So I moved <load> above <options>.

<tsung>
  <clients>...</clients>
  <servers>...</servers>
  <monitoring>...</monitoring>
  <load>...</load>
  <options>...</options>
  <sessions>...</sessions>
</tsung>

Tsung doesn't complain anymore about the XML. It runs.

Upvotes: 1

Moorthi Raj
Moorthi Raj

Reputation: 21

use the below transaction values for "connect" with 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>

Also, you have to add options value as like below,

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

Please cross check with server team about the TLS version.

Let me know if you have any queries.

Upvotes: 0

user2855537
user2855537

Reputation: 11

Did you succed to run it without TSL?

Upvotes: -1

Related Questions