Skip to content

Commit

Permalink
Merge branch 'master' of git.process-one.net:tsung/mainline
Browse files Browse the repository at this point in the history
Conflicts:
	src/tsung_stats.pl.in
	tsung-1.0.dtd
  • Loading branch information
nniclausse committed Sep 11, 2012
2 parents f684964 + 6464f42 commit 11c9caa
Show file tree
Hide file tree
Showing 46 changed files with 3,197 additions and 215 deletions.
7 changes: 6 additions & 1 deletion Makefile.in
Expand Up @@ -82,7 +82,7 @@ MAN_DIR = $(datadir)/man/man1/
DOC_DIR = $(docdir)

# custom behaviours
BEHAVIORS = ebin/ts_plugin.beam
BEHAVIORS = ebin/ts_plugin.beam ebin/gen_ts_transport.beam

BUILDER_LOG = /tmp/builder-tsung.log

Expand Down Expand Up @@ -436,6 +436,11 @@ ebin/ts_plugin.beam: src/$(APPLICATION)/ts_plugin.erl $(INC_FILES)
@echo "Compiling $< ... "
@$(CC) $(OPT) -I $(INC) -I $(ERLANG_XMERL_DIR) -pa ebin -o ebin $<

# to avoid circular dependency
ebin/gen_ts_transport.beam: src/$(APPLICATION)/gen_ts_transport.erl $(INC_FILES)
@echo "Compiling $< ... "
@$(CC) $(OPT) -I $(INC) -I $(ERLANG_XMERL_DIR) -pa ebin -o ebin $<

ebin/%.beam: src/$(APPLICATION)/%.erl $(INC_FILES) $(BEHAVIORS)
@echo "Compiling $< ... "
@$(CC) $(OPT) -I $(INC) -I $(ERLANG_XMERL_DIR) -pa ebin -o ebin $<
Expand Down
18 changes: 9 additions & 9 deletions configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for tsung 1.4.3a.
# Generated by GNU Autoconf 2.68 for tsung 1.5.0a.
#
# Report bugs to <tsung-users@process-one.net>.
#
Expand Down Expand Up @@ -561,8 +561,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='tsung'
PACKAGE_TARNAME='tsung'
PACKAGE_VERSION='1.4.3a'
PACKAGE_STRING='tsung 1.4.3a'
PACKAGE_VERSION='1.5.0a'
PACKAGE_STRING='tsung 1.5.0a'
PACKAGE_BUGREPORT='tsung-users@process-one.net'
PACKAGE_URL=''

Expand Down Expand Up @@ -1188,7 +1188,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures tsung 1.4.3a to adapt to many kinds of systems.
\`configure' configures tsung 1.5.0a to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1249,7 +1249,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of tsung 1.4.3a:";;
short | recursive ) echo "Configuration of tsung 1.5.0a:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1329,7 +1329,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
tsung configure 1.4.3a
tsung configure 1.5.0a
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1390,7 +1390,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by tsung $as_me 1.4.3a, which was
It was created by tsung $as_me 1.5.0a, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -3702,7 +3702,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by tsung $as_me 1.4.3a, which was
This file was extended by tsung $as_me 1.5.0a, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -3755,7 +3755,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
tsung config.status 1.4.3a
tsung config.status 1.5.0a
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
Expand Down
85 changes: 81 additions & 4 deletions doc/user_manual.html
Expand Up @@ -95,8 +95,8 @@
<!--ENDHTML-->
<!--CUT DEF section 1 --><H1 ALIGN=center>Tsung User’s manual</H1><DIV CLASS="center">

<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1><TR><TD ALIGN=left NOWRAP bgcolor="#F2F2F2"> Version:</TD><TD ALIGN=left NOWRAP>1.4.2</TD></TR>
<TR><TD ALIGN=left NOWRAP bgcolor="#F2F2F2"> Date :</TD><TD ALIGN=left NOWRAP>August 30, 2012</TD></TR>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1><TR><TD ALIGN=left NOWRAP bgcolor="#F2F2F2"> Version:</TD><TD ALIGN=left NOWRAP>1.5.0</TD></TR>
<TR><TD ALIGN=left NOWRAP bgcolor="#F2F2F2"> Date :</TD><TD ALIGN=left NOWRAP>September 10, 2012</TD></TR>
</TABLE>
</DIV><!--TOC section Contents-->
<H2 CLASS="section"><!--SEC ANCHOR -->Contents</H2><!--SEC END --><UL CLASS="toc"><LI CLASS="li-toc">
Expand Down Expand Up @@ -1452,7 +1452,7 @@ <H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc55">6.6</A>  Sessions</H
<A NAME="sec:sessions"></A></P><P>Sessions define the content of the scenario itself. They describe
the requests to execute.</P><P>Each session has a given probability. This is used to decide which
session a new user will execute. The sum of all session<CODE>'</CODE>s
probabilities must be 100.</P><P><B>Since Tsung 1.4.3</B>, you can use weights instead of
probabilities must be 100.</P><P><B>Since Tsung 1.5.0</B>, you can use weights instead of
probabilities. In the following example, there will be twice as many
sessions of type s1 than s2.
</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
Expand Down Expand Up @@ -1648,6 +1648,83 @@ <H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc57">6.6.2</A>  HTTP</
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><!--TOC paragraph Authentication-->
<H5 CLASS="paragraph"><!--SEC ANCHOR -->Authentication</H5><!--SEC END --><P>Until Tsung 1.5.0, only Basic authentication was implemented. You can
now use Digest Authentication and OAuth 1.0.</P><P>To use Digest authentication:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> &lt;!-- 1. First request return 401. We use dynvars to fetch nonce and realm --&gt;
&lt;request&gt;
&lt;dyn_variable name="nonce" header="www-authenticate/nonce"/&gt;
&lt;dyn_variable name="realm" header="www-authenticate/realm"/&gt;
&lt;http url="/digest" method="GET" version="1.1"/&gt;
&lt;/request&gt;

&lt;!--
2. This request will be authenticated. Type="digest" is important.
We use the nonce and realm values returned from the previous
If the webserver returns the nextnonce we set it to the nonce dynvar
for use with the next request.
Else it stays set to the old value
--&gt;
&lt;request subst="true"&gt;
&lt;dyn_variable name="nonce" header="authentication-info/nextnonce"/&gt;
&lt;http url="/digest" method="GET" version="1.1"&gt;
&lt;www_authenticate userid="user" passwd="passwd" type="digest" realm="%%_realm%%" nonce="%%_nonce%%"/&gt;
&lt;/http&gt;
&lt;/request&gt;
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><P>To use OAuth authentication:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> &lt;!-- Getting a Request Token --&gt;

&lt;request&gt;
&lt;dyn_variable name="access_token" re="oauth_token=([^&amp;amp;]*)"/&gt;
&lt;dyn_variable name="access_token_secret" re="oauth_token_secret=([^&amp;amp;]*)" /&gt;
&lt;http url="/oauth/example/request_token.php" method="POST" version="1.1" contents="empty"&gt;
&lt;oauth consumer_key="key" consumer_secret="secret" method="HMAC-SHA1"/&gt;
&lt;/http&gt;
&lt;/request&gt;

&lt;!-- Getting an Access Token --&gt;

&lt;request subst='true'&gt;
&lt;dyn_variable name="access_token" re="oauth_token=([^&amp;amp;]*)"/&gt;
&lt;dyn_variable name="access_token_secret" re="oauth_token_secret=([^&amp;amp;]*)"/&gt;
&lt;http url="/oauth/example/access_token.php" method="POST" version="1.1" contents="empty"&gt;
&lt;oauth consumer_key="key" consumer_secret="secret" method="HMAC-SHA1" access_token="%%_access_token%%" access_token_secret="%%_access_token_secret%%"/&gt;
&lt;/http&gt;
&lt;/request&gt;

&lt;!-- Making Authenticated Calls --&gt;

&lt;request subst="true"&gt;
&lt;http url="/oauth/example/echo_api.php" method="GET" version="1.1"&gt;
&lt;oauth consumer_key="key" consumer_secret="secret" access_token="%%_access_token%%" access_token_secret="%%_access_token_secret%%"/&gt;
&lt;/http&gt;
&lt;/request&gt;
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><!--TOC subsubsection Jabber/XMPP-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc58">6.6.3</A>  Jabber/XMPP</H4><!--SEC END --><P><A NAME="sec:sessions:jabber"></A>
</P><P>Here is an example of a session definition for the Jabber/XMPP protocol:
Expand Down Expand Up @@ -2035,7 +2112,7 @@ <H5 CLASS="paragraph"><!--SEC ANCHOR -->raw XML</H5><!--SEC END --><P>
</TABLE><P>Beware: you must encode XML characters like <FONT COLOR=purple>&lt;</FONT>
,<FONT COLOR=purple>&gt;</FONT>, <FONT COLOR=purple>&amp;</FONT>, etc.</P><!--TOC paragraph resource-->
<H5 CLASS="paragraph"><!--SEC ANCHOR -->resource</H5><!--SEC END --><P>By default, the XMPP resource is set to <FONT COLOR=purple>tsung</FONT>. Since
version 1.4.3, you can override this (in all <TT>auth_*</TT> and
version 1.5.0, you can override this (in all <TT>auth_*</TT> and
<TT>register</TT> requests) using the <TT>resource</TT> attribute.</P><!--TOC subsubsection PostgreSQL-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc59">6.6.4</A>  PostgreSQL</H4><!--SEC END --><P>For PostgreSQL, 4 types of requests are available:
</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
Expand Down
73 changes: 68 additions & 5 deletions doc/user_manual.tex
Expand Up @@ -14,7 +14,7 @@
%\addauthor{Nicolas}{Niclausse}{nicolas.niclausse@niclux.org}

\doccopyright{Nicolas Niclausse.}
\docversion{1.4.2}
\docversion{1.5.0}
\docreldate{\date{}}
\docref{tsung-user-manual}

Expand Down Expand Up @@ -171,7 +171,7 @@ \subsection{HTTP related features}
\item Cookies: Automatic cookies management( but you can also manually
add more cookies)
\item \verb|'|GET If-modified since\verb|'| type of request
\item WWW-authentication Basic
\item WWW-authentication Basic and Digest. OAuth 1.0
\item User Agent support
\item Any HTTP Headers can be added
\item Proxy mode to record sessions using a Web browser
Expand All @@ -196,12 +196,13 @@ \subsection{WEBDAV related features}
\subsection{Jabber/XMPP related features}

\begin{itemize}
\item Authentication (plain-text, digest and sip-digest)
\item Authentication (plain-text, digest and sip-digest). STARTTLS
\item presence and register messages
\item Chat messages to online or offline users
\item MUC: join room, send message in room, change nickname
\item Roster set and get requests
\item Global users\verb|'| synchronization can be set on specific actions
\item BOSH \& XMPP over Websocket
\item raw XML messages
\item PubSub
\item Multiple vhost instances supported
Expand Down Expand Up @@ -1187,7 +1188,7 @@ \subsection{Sessions}
session a new user will execute. The sum of all session\verb|'|s
probabilities must be 100.
\strong{Since Tsung 1.4.3}, you can use weights instead of
\strong{Since Tsung 1.5.0}, you can use weights instead of
probabilities. In the following example, there will be twice as many
sessions of type s1 than s2.
\begin{Verbatim}
Expand Down Expand Up @@ -1314,6 +1315,68 @@ \subsubsection{HTTP}
</http>
\end{Verbatim}
\paragraph{Authentication}
Until Tsung 1.5.0, only Basic authentication was implemented. You can
now use Digest Authentication and OAuth 1.0.
To use Digest authentication:
\begin{Verbatim}
<!-- 1. First request return 401. We use dynvars to fetch nonce and realm -->
<request>
<dyn_variable name="nonce" header="www-authenticate/nonce"/>
<dyn_variable name="realm" header="www-authenticate/realm"/>
<http url="/digest" method="GET" version="1.1"/>
</request>
<!--
2. This request will be authenticated. Type="digest" is important.
We use the nonce and realm values returned from the previous
If the webserver returns the nextnonce we set it to the nonce dynvar
for use with the next request.
Else it stays set to the old value
-->
<request subst="true">
<dyn_variable name="nonce" header="authentication-info/nextnonce"/>
<http url="/digest" method="GET" version="1.1">
<www_authenticate userid="user" passwd="passwd" type="digest" realm="%%_realm%%" nonce="%%_nonce%%"/>
</http>
</request>
\end{Verbatim}
To use OAuth authentication:
\begin{Verbatim}
<!-- Getting a Request Token -->
<request>
<dyn_variable name="access_token" re="oauth_token=([^&amp;]*)"/>
<dyn_variable name="access_token_secret" re="oauth_token_secret=([^&amp;]*)" />
<http url="/oauth/example/request_token.php" method="POST" version="1.1" contents="empty">
<oauth consumer_key="key" consumer_secret="secret" method="HMAC-SHA1"/>
</http>
</request>
<!-- Getting an Access Token -->
<request subst='true'>
<dyn_variable name="access_token" re="oauth_token=([^&amp;]*)"/>
<dyn_variable name="access_token_secret" re="oauth_token_secret=([^&amp;]*)"/>
<http url="/oauth/example/access_token.php" method="POST" version="1.1" contents="empty">
<oauth consumer_key="key" consumer_secret="secret" method="HMAC-SHA1" access_token="%%_access_token%%" access_token_secret="%%_access_token_secret%%"/>
</http>
</request>
<!-- Making Authenticated Calls -->
<request subst="true">
<http url="/oauth/example/echo_api.php" method="GET" version="1.1">
<oauth consumer_key="key" consumer_secret="secret" access_token="%%_access_token%%" access_token_secret="%%_access_token_secret%%"/>
</http>
</request>
\end{Verbatim}
\subsubsection{Jabber/XMPP}
\label{sec:sessions:jabber}
Expand Down Expand Up @@ -1639,7 +1702,7 @@ \subsubsection{Jabber/XMPP}
\paragraph{resource}
By default, the XMPP resource is set to \userinput{tsung}. Since
version 1.4.3, you can override this (in all \varname{auth\_*} and
version 1.5.0, you can override this (in all \varname{auth\_*} and
\varname{register} requests) using the \varname{resource} attribute.
\subsubsection{PostgreSQL}
Expand Down
57 changes: 57 additions & 0 deletions examples/http-digest.xml.in
@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "@prefix@/share/@PACKAGE_NAME@/@DTD@">
<tsung loglevel="debug" dumptraffic="true" version="1.0">

<clients>
<client host="localhost" weight="1" maxusers="1000" use_controller_vm="true"/>
</clients>

<servers>
<server host="localhost" port="443" type="ssl"></server>
</servers>

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

<sessions>
<session name="http_test_1" probability="100" type="ts_http">
<!--
1. First request return 401. We use dynvars to fetch nonce and realm
-->
<request>
<dyn_variable name="nonce" header="www-authenticate/nonce"/>
<dyn_variable name="realm" header="www-authenticate/realm"/>
<http url="/digest" method="GET" version="1.1">
</http>
</request>
<!--
2. This request will be authenticated. Type="digest" is important.
We use the nonce and realm values returned from the previous
If the webserver returns the nextnonce we set it to the nonce dynvar
for use with the next request.
Else it stays set to the old value
-->
<request subst="true">
<dyn_variable name="nonce" header="authentication-info/nextnonce"/>
<http url="/digest" method="GET" version="1.1">
<www_authenticate userid="user" passwd="passwd" type="digest" realm="%%_realm%%" nonce="%%_nonce%%"/>
<!--<www_authenticate userid="user" passwd="passwd" type="digest" realm="%%_realm%%" nonce="%%_nonce%%" nc="00000001" cnonce="%%ts_user_server:get_really_unique_id%%"/>-->
</http>
</request>

<!--
2. This request will still be authenticated
-->
<request subst="true">
<dyn_variable name="nonce" header="authentication-info/nextnonce"/>
<http url="/digest" method="GET" version="1.1">
<www_authenticate userid="user" passwd="passwd" type="digest" realm="%%_realm%%" nonce="%%_nonce%%"/>
</http>
</request>
</session>
</sessions>

</tsung>

0 comments on commit 11c9caa

Please sign in to comment.