0

I have a problem with removing roster contacts in Tsung. I tried to ask them, but no one answered to my mail. Everything in my config(.xml) is like in their documentation, but only adding contacts is working, renaming and removing doesn't work. Here is my session code:

<session bidi="true" probability="100" name="AddRoster" type="ts_jabber">
    <request> <jabber type="connect" ack="local"></jabber> </request>
    <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="2"></thinktime>
    <request> <jabber type="iq:roster:get" ack="local"/> </request>
    <thinktime value="2"></thinktime>
    <request> <jabber type="presence:initial" ack="no_ack"/> </request>
    <thinktime value="40"></thinktime>
    <for from="1" to="100" incr="1" var="counter">
        <transaction name="add_roster">
                <request> <jabber type="iq:roster:add" ack="no_ack" destination="online"> </jabber> </request>
                <request> <jabber type="presence:subscribe" ack="no_ack"/> </request>
            </transaction>
    </for>
    <for from="1" to="50" incr="1" var="counter">
        <transaction name="rosterrename">
                <request> <jabber type="iq:roster:rename" ack="no_ack"></jabber> </request>
            </transaction>
    </for>
    <for from="1" to="100" incr="1" var="counter">
            <transaction name="rosterdelete">
                <request> <jabber type="iq:roster:remove" ack="no_ack"></jabber> </request>
            </transaction>
    </for>
    <thinktime value="400"></thinktime>
    <request> <jabber type="presence:final" ack="no_ack"/> </request>
    <thinktime value="1"></thinktime>
    <request> <jabber type="close" ack="local"></jabber> </request>
</session>
Aliaksandr Belik
  • 12,725
  • 6
  • 64
  • 90
vomidi
  • 1
  • 1

1 Answers1

0

Above the Tsung's document from here http://tsung.erlang-projects.org/user_manual.html#htoc58 , I guess your problem caused by the three for loop !!!

You can try like this :

<for from="1" to="50" incr="1" var="counter">

<transaction name="rosteradd">
  <request>
    <jabber type="iq:roster:add" ack="no_ack" destination="online"></jabber>
  </request>
  <request>
    <jabber type="presence:subscribe" ack="no_ack"/>
  </request>
</transaction>

<!-- ... -->

<transaction name="rosterrename">
  <request> <jabber type="iq:roster:rename" ack="no_ack"></jabber> </request>
</transaction>

<!-- ... -->

<transaction name="rosterdelete">
  <request> <jabber type="iq:roster:remove" ack="no_ack"></jabber> </request>
</transaction>

</for>

Because Tsung has it's own context ! So if you do add/rename/delete in different loops,the context is different too. Just do that transaction in one loop !

Gentle Y
  • 331
  • 1
  • 10
  • And also you can send a request with jabber type=raw where your own XML is in the data attribute. Ref http://tsung.erlang-projects.org/user_manual.html#htoc58 to see how to send raw XML. – Gentle Y Mar 28 '12 at 03:40