Comments (6)
As far as I can tell, the value is currently not substituted.
However it's a bit hard to fully understand your problem. Could you please surround your XML configuration using ``` (code blocks)? And I'd appreachiate it if you could format your XML a little bit to make it easier to read :)
from tsung.
Ok,thank you.
<options>
<option name="file_server" id="userdb" value="/usr/local/tsung6/hanhy/login/case1/enc.csv"></option>
</options>
<sessions>
<session probability="100" name="raw" type="ts_raw">
<setdynvars sourcetype="file" fileid="userdb" delimiter="," order="iter">
<var name="userid"/>
<var name="username"/>
</setdynvars>
<transaction name="data">
<request subst="true">
<dyn_variable name="loginTag" re="<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">(.*)@im.ebnew.com/Tsung</success>"/>
<raw data="<auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" resource="Tsung">%%_username%%</auth>" ack="local"></raw>
</request>
</transaction>
<thinktime value="4"/>
<transaction name="close">
<if var="loginTag" eq="userid">
<request>
<raw data="stopstopstop" ack="local"></raw>
</request>
</if>
</transaction>
</session>
</sessions>
from tsung.
I think the DSL does not (yet) support dynamic variable expansion in the control flow blocks such as if
.
If you really need this now, you could try...
<setdynvars sourcetype="eval"
code="fun({Pid,DynVars})->
{ok,Val1}=ts_dynvars:lookup(loginTag,DynVars),
{ok,Val2}=ts_dynvars:lookup(userid,DynVars),
Val1 =:= Val2 end.">
<var name="is_expected_userid" />
</setdynvars>
<transaction name="close">
<if var="is_expected_userid" eq="true">
<request>
<raw data="stopstopstop" ack="local"></raw>
</request>
</if>
</transaction>
from tsung.
Could we close this?
Or maybe tag this as an enhancement?
@alicehanhy, by the way, did the "workaround" work for you?
from tsung.
Ok
from tsung.
IMO the value
part of <if>
should support substitution.
Adding this should be fairly simple. Code to take a look at is this:
Lines 646 to 656 in fbd11cb
Value
needs to be processed via ts_search:subst
. This way it may contain placeholders like foo-%%_userid%%
.
from tsung.
Related Issues (20)
- Mean value is empty and count is 0 in the generated report
- The load is not generated from mulitple client instances as expected in distributed environment HOT 1
- Cannot do "contents_from_file" and '<request subst="true">' at the same time HOT 1
- datestr_test failed with erlang 21 HOT 1
- Error using tsung view after running load test
- Tsung 1.7.0 crashes on start HOT 3
- Getting config error while start a demo mqtt.xml.in script
- Are there any methods for getting only 400s or 500s error in tsung protocol dump file?
- Can I test TCP in tsung but using SSL? HOT 1
- Unable to view graphs on webui HOT 1
- Massive CPU usage after a certain point
- Tsung doen't respond with PONG
- Monitoring with snmp does not work
- Will start 0 users? Do I config error? HOT 1
- How can I test TCP and check recv package?
- How can i send all XMPP messages to a specific user? HOT 1
- Erlang OTP 26 ssl defaults HOT 1
- ssl hand shake fail
- tsung-recorder creates unusable data
- Missing opening curly bracket near @formats
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tsung.