1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701
|
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>FunkLoad</title>
<meta name="author" content="Benoit Delbosc" />
<meta name="copyright" content="(C) Copyright 2005 Nuxeo SAS (http://nuxeo.com). This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." />
<style type="text/css">
/* funkload doc css */
/* $Id: nuxeo_doc.css 21596 2005-02-15 10:01:33Z bdelbosc $ */
body {
font: 90% 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
background: #ffffff;
color: black;
margin: 2em;
padding: 2em;
}
a[href] {
color: #436976;
background-color: transparent;
}
h1 a[href] {
text-decoration: none;
color: #fcb100;
background-color: transparent;
}
a.strong {
font-weight: bold;
}
img {
margin: 0;
border: 0;
}
p {
margin: 0.5em 0 1em 0;
line-height: 1.5em;
}
p a {
text-decoration: underline;
}
p a:visited {
color: purple;
background-color: transparent;
}
p a:active {
color: red;
background-color: transparent;
}
a:hover {
text-decoration: none;
}
p img {
border: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6 {
color: #003a6b;
background-color: transparent;
font: 100% 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
margin: 0;
padding-top: 0.5em;
}
h1 {
font-size: 160%;
margin-bottom: 0.5em;
border-bottom: 1px solid #888;
margin-top: 1em;
}
h1.title {
font-size: 200%;
}
h2 {
font-size: 140%;
margin-bottom: 0.5em;
}
h3 {
font-size: 120%;
margin-bottom: 0.5em;
}
h4 {
font-size: 110%;
font-weight: bold;
}
h5 {
font-size: 100%;
font-weight: bold;
}
h6 {
font-size: 80%;
font-weight: bold;
}
ul a, ol a {
text-decoration: underline;
}
dt {
font-weight: bold;
}
dt a {
text-decoration: none;
}
dd {
line-height: 1.5em;
margin-bottom: 1em;
}
legend {
background: #ffffff;
padding: 0.5em;
}
form {
margin: 0;
}
dl.form {
margin: 0;
padding: 1em;
}
dl.form dt {
width: 30%;
float: left;
margin: 0;
padding: 0 0.5em 0.5em 0;
text-align: right;
}
input {
font: 100% 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
color: black;
background-color: white;
vertical-align: middle;
}
abbr, acronym, .explain {
color: black;
background-color: transparent;
}
q, blockquote {
}
code, pre {
font-family: monospace;
font-size: 1.2em;
display: block;
padding: 10px;
border: 1px solid #838183;
background-color: #eee;
color: #000;
overflow: auto;
margin: 0.5em 1em;
}
table.docutils {
border: 1px solid black;
font-size: 0.6em;
border-spacing: 0;
padding: 0;
margin: 1em;
}
table.docutils td {
border: 1px solid #CCC;
text-align: right;
padding: 0 0.3em;
margin: 0;
}
table.docutils tr {
padding: 0;
margin: 0;
}
table.docutils th {
border: 1px solid #CCC;
border-bottom: 1px solid black;
padding: 0.3em;
font-weight: bold;
margin: 0;
}
table.docutils td p, table.docutils th p {
margin: 0;
padding: 0;
}
table.docutils th.field-name {
border: 1px solid #CCC;
}
div.abstract {
padding: 0.5em;
background-color: #eef;
border: 1px solid #838183;
margin: 0.5em 1em;
}
div.abstract {
padding: 0.5em;
background-color: #eef;
border: 1px solid #838183;
margin: 0.5em 1em;
}
div.warning, div.note {
padding: 0.5em;
background-color: #fee;
border: 1px solid #838183;
margin: 0.5em 1em;
}
div.warning p.admonition-title {
color: red ;
font-weight: bold ;
}
div.abstract p.topic-title {
font-weight: bold
}
th.field-name {
font-weight: bold;
font-size: 1.5em;
}
td.field-body {
font-size: 1.5em;
}
tr.field {
border: none;
}
div.contents p.first a {
font-size: 150%;
border-bottom: 1px solid #888;
color: #fcb100;
}
div.contents a { text-decoration: none }
pre.address {
display: inline;
border: none;
padding: 0;
margin: 0;
}
</style>
</head>
<body>
<div class="document" id="funkload">
<h1 class="title"><a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a></h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Benoit Delbosc</td></tr>
<tr><th class="docinfo-name">Address:</th>
<td><pre class="address">
bdelbosc _at_ nuxeo.com
</pre>
</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>FunkLoad/1.6.2</td></tr>
<tr><th class="docinfo-name">Revision:</th>
<td>README.txt 51931 2007-07-30 08:00:57Z bdelbosc</td></tr>
<tr><th class="docinfo-name">Copyright:</th>
<td>(C) Copyright 2005 Nuxeo SAS (<a class="reference" href="http://nuxeo.com">http://nuxeo.com</a>).
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</td></tr>
</tbody>
</table>
<div class="abstract topic">
<p class="topic-title first">Abstract</p>
<p>This document describes the usage of the <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> tool. This tool
enables to do functional and load testing of web application.</p>
</div>
<div class="contents topic">
<p class="topic-title first"><a id="table-of-contents" name="table-of-contents">Table of Contents</a></p>
<ul class="auto-toc simple">
<li><a class="reference" href="#introducing-funkload" id="id14" name="id14">1 Introducing FunkLoad</a><ul class="auto-toc">
<li><a class="reference" href="#what-is-funkload" id="id15" name="id15">1.1 What is FunkLoad ?</a></li>
<li><a class="reference" href="#where-to-find-funkload" id="id16" name="id16">1.2 Where to find FunkLoad ?</a></li>
<li><a class="reference" href="#installation" id="id17" name="id17">1.3 Installation</a></li>
<li><a class="reference" href="#examples" id="id18" name="id18">1.4 Examples</a></li>
<li><a class="reference" href="#documentation" id="id19" name="id19">1.5 Documentation</a></li>
<li><a class="reference" href="#credits" id="id20" name="id20">1.6 Credits</a></li>
</ul>
</li>
<li><a class="reference" href="#test-runner" id="id21" name="id21">2 Test runner</a><ul class="auto-toc">
<li><a class="reference" href="#usage" id="id22" name="id22">2.1 Usage</a></li>
<li><a class="reference" href="#id1" id="id23" name="id23">2.2 Examples</a></li>
<li><a class="reference" href="#options" id="id24" name="id24">2.3 Options</a></li>
</ul>
</li>
<li><a class="reference" href="#benching" id="id25" name="id25">3 Benching</a><ul class="auto-toc">
<li><a class="reference" href="#principle" id="id26" name="id26">3.1 Principle</a><ul>
<li><a class="reference" href="#page" id="id27" name="id27">Page</a></li>
<li><a class="reference" href="#test" id="id28" name="id28">Test</a></li>
<li><a class="reference" href="#cycle" id="id29" name="id29">Cycle</a></li>
<li><a class="reference" href="#cycles" id="id30" name="id30">Cycles</a></li>
</ul>
</li>
<li><a class="reference" href="#bench-runner" id="id31" name="id31">3.2 Bench runner</a><ul>
<li><a class="reference" href="#id2" id="id32" name="id32">Usage</a></li>
<li><a class="reference" href="#id3" id="id33" name="id33">Examples</a></li>
<li><a class="reference" href="#id4" id="id34" name="id34">Options</a></li>
</ul>
</li>
<li><a class="reference" href="#tips" id="id35" name="id35">3.3 Tips</a></li>
</ul>
</li>
<li><a class="reference" href="#bench-report" id="id36" name="id36">4 Bench report</a><ul class="auto-toc">
<li><a class="reference" href="#id5" id="id37" name="id37">4.1 Usage</a></li>
<li><a class="reference" href="#id6" id="id38" name="id38">4.2 Examples</a></li>
<li><a class="reference" href="#id7" id="id39" name="id39">4.3 Options</a></li>
</ul>
</li>
<li><a class="reference" href="#test-recorder" id="id40" name="id40">5 Test Recorder</a><ul class="auto-toc">
<li><a class="reference" href="#recording-a-new-funkload-test" id="id41" name="id41">5.1 Recording a new FunkLoad test</a></li>
<li><a class="reference" href="#the-fl-record-command" id="id42" name="id42">5.2 The fl-record command</a><ul>
<li><a class="reference" href="#id8" id="id43" name="id43">Usage</a></li>
<li><a class="reference" href="#id9" id="id44" name="id44">Examples</a></li>
<li><a class="reference" href="#id10" id="id45" name="id45">Options</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference" href="#credential-server" id="id46" name="id46">6 Credential server</a></li>
<li><a class="reference" href="#monitor-server" id="id47" name="id47">7 Monitor server</a></li>
<li><a class="reference" href="#the-funkloadtestcase" id="id48" name="id48">8 The FunkLoadTestCase</a><ul class="auto-toc">
<li><a class="reference" href="#browser-api" id="id49" name="id49">8.1 Browser API</a><ul>
<li><a class="reference" href="#get" id="id50" name="id50">get</a></li>
<li><a class="reference" href="#post" id="id51" name="id51">post</a></li>
<li><a class="reference" href="#exists" id="id52" name="id52">exists</a></li>
<li><a class="reference" href="#setbasicauth" id="id53" name="id53">setBasicAuth</a></li>
<li><a class="reference" href="#clearbasicauth" id="id54" name="id54">clearBasicAuth</a></li>
<li><a class="reference" href="#setuseragent" id="id55" name="id55">setUserAgent</a></li>
<li><a class="reference" href="#addheader" id="id56" name="id56">addHeader</a></li>
<li><a class="reference" href="#clearheaders" id="id57" name="id57">clearHeaders</a></li>
</ul>
</li>
<li><a class="reference" href="#xml-rpc-api" id="id58" name="id58">8.2 XML RPC API</a><ul>
<li><a class="reference" href="#xmlrpc" id="id59" name="id59">xmlrpc</a></li>
</ul>
</li>
<li><a class="reference" href="#assertion-helpers-api" id="id60" name="id60">8.3 Assertion helpers API</a><ul>
<li><a class="reference" href="#getlasturl" id="id61" name="id61">getLastUrl</a></li>
<li><a class="reference" href="#getlastbaseurl" id="id62" name="id62">getLastBaseUrl</a></li>
<li><a class="reference" href="#listhref" id="id63" name="id63">listHref</a></li>
<li><a class="reference" href="#getbody" id="id64" name="id64">getBody</a></li>
<li><a class="reference" href="#the-response-object" id="id65" name="id65">The response object</a></li>
</ul>
</li>
<li><a class="reference" href="#configuration-file-api" id="id66" name="id66">8.4 Configuration file API</a><ul>
<li><a class="reference" href="#conf-get" id="id67" name="id67">conf_get</a></li>
<li><a class="reference" href="#conf-getint" id="id68" name="id68">conf_getInt</a></li>
<li><a class="reference" href="#conf-getfloat" id="id69" name="id69">conf_getFloat</a></li>
<li><a class="reference" href="#conf-getlist" id="id70" name="id70">conf_getList</a></li>
</ul>
</li>
<li><a class="reference" href="#logging" id="id71" name="id71">8.5 Logging</a><ul>
<li><a class="reference" href="#logd" id="id72" name="id72">logd</a></li>
<li><a class="reference" href="#logi" id="id73" name="id73">logi</a></li>
</ul>
</li>
<li><a class="reference" href="#lipsum-api" id="id74" name="id74">8.6 Lipsum API</a><ul>
<li><a class="reference" href="#lipsum" id="id75" name="id75">Lipsum</a></li>
<li><a class="reference" href="#getword" id="id76" name="id76">getWord</a></li>
<li><a class="reference" href="#getuniqword" id="id77" name="id77">getUniqWord</a></li>
<li><a class="reference" href="#getsubject" id="id78" name="id78">getSubject</a></li>
<li><a class="reference" href="#getsentence" id="id79" name="id79">getSentence</a></li>
<li><a class="reference" href="#getparagraph" id="id80" name="id80">getParagraph</a></li>
<li><a class="reference" href="#getmessage" id="id81" name="id81">getMessage</a></li>
<li><a class="reference" href="#getphonenumber" id="id82" name="id82">getPhoneNumber</a></li>
<li><a class="reference" href="#getaddress" id="id83" name="id83">getAddress</a></li>
</ul>
</li>
<li><a class="reference" href="#utils" id="id84" name="id84">8.7 Utils</a><ul>
<li><a class="reference" href="#xmlrpc-get-credential" id="id85" name="id85">xmlrpc_get_credential</a></li>
<li><a class="reference" href="#xmlrpc-list-groups" id="id86" name="id86">xmlrpc_list_groups</a></li>
<li><a class="reference" href="#xmlrpc-list-credentials" id="id87" name="id87">xmlrpc_list_credentials</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference" href="#funkloaddoctest" id="id88" name="id88">9 FunkLoadDocTest</a></li>
<li><a class="reference" href="#other-test-cases" id="id89" name="id89">10 Other Test Cases</a><ul class="auto-toc">
<li><a class="reference" href="#the-zopetestcase" id="id90" name="id90">10.1 The ZopeTestCase</a><ul>
<li><a class="reference" href="#zoperestart" id="id91" name="id91">zopeRestart</a></li>
<li><a class="reference" href="#zopepackzodb" id="id92" name="id92">zopePackZodb</a></li>
<li><a class="reference" href="#zopeflushcache" id="id93" name="id93">zopeFlushCache</a></li>
<li><a class="reference" href="#zopeaddexternalmethod" id="id94" name="id94">zopeAddExternalMethod</a></li>
</ul>
</li>
<li><a class="reference" href="#cpstestcase" id="id95" name="id95">10.2 CPSTestCase</a><ul>
<li><a class="reference" href="#cpscreatesite" id="id96" name="id96">cpsCreateSite</a></li>
<li><a class="reference" href="#cpslogin" id="id97" name="id97">cpsLogin</a></li>
<li><a class="reference" href="#cpslogout" id="id98" name="id98">cpsLogout</a></li>
<li><a class="reference" href="#cpscreategroup" id="id99" name="id99">cpsCreateGroup</a></li>
<li><a class="reference" href="#cpsverifygroup" id="id100" name="id100">cpsVerifyGroup</a></li>
<li><a class="reference" href="#cpscreateuser" id="id101" name="id101">cpsCreateUser</a></li>
<li><a class="reference" href="#cpsverifyuser" id="id102" name="id102">cpsVerifyUser</a></li>
<li><a class="reference" href="#cpssetlocalrole" id="id103" name="id103">cpsSetLocalRole</a></li>
<li><a class="reference" href="#cpscreatesection" id="id104" name="id104">cpsCreateSection</a></li>
<li><a class="reference" href="#cpscreateworkspace" id="id105" name="id105">cpsCreateWorkspace</a></li>
<li><a class="reference" href="#cpscreatedocument" id="id106" name="id106">cpsCreateDocument</a></li>
<li><a class="reference" href="#cpscreatenewsitem" id="id107" name="id107">cpsCreateNewsItem</a></li>
<li><a class="reference" href="#cpschangeuilanguage" id="id108" name="id108">cpsChangeUiLanguage</a></li>
<li><a class="reference" href="#cpslistdocumenthref" id="id109" name="id109">cpsListDocumentHref</a></li>
<li><a class="reference" href="#cpssearchdocid" id="id110" name="id110">cpsSearchDocId</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference" href="#todo-and-bugs" id="id111"
name="id111">11 Todo and bugs</a></li>
</ul>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id14" id="introducing-funkload"
name="introducing-funkload">1 Introducing FunkLoad</a></h1>
<div class="section">
<h2><a class="toc-backref" href="#id15" id="what-is-funkload"
name="what-is-funkload">1.1 What is FunkLoad ?</a></h2>
<p><a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> is a
functional and load web tester, written in Python, whose
main use cases are:</p>
<ul class="simple">
<li>Functional testing of web projects, and thus regression testing as well.</li>
<li>Performance testing: by loading the web application and monitoring
your servers it helps you to pinpoint bottlenecks, giving a detailed
report of performance measurement.</li>
<li>Load testing tool to expose bugs that do not surface in cursory testing,
like volume testing or longevity testing.</li>
<li>Stress testing tool to overwhelm the web application resources and test
the application recoverability.</li>
<li>Writing web agents by scripting any web repetitive task, like checking if
a site is alive.</li>
</ul>
<p>Main <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a>
features are:</p>
<ul class="simple">
<li><a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> is
free software distributed under the <a class="reference"
href="http://www.gnu.org/licenses/licenses.html">GNU GPL</a>.</li>
<li>Functional test are pure Python scripts using the <a class="reference"
href="http://pyunit.sourceforge.net/">pyUnit</a> framework like
normal unit test. Python enable complex scenarios to handle real world
applications.</li>
<li>Truly emulates a web browser (single-threaded) using Richard Jones'
<a class="reference" href="http://mechanicalcat.net/tech/webunit/">webunit</a>:<ul>
<li>basic authentication support</li>
<li>cookies support</li>
<li>referrer support</li>
<li>fetching css, javascript and images</li>
<li>emulating a browser cache</li>
<li>file upload and multipart/form-data submission</li>
<li>https support</li>
<li>http_proxy support</li>
</ul>
</li>
<li>Advanced test runner with many command-line options:<ul>
<li>set the target server url</li>
<li>display the fetched page in real time in your browser</li>
<li>debug mode</li>
<li>check performance of a single page (or set of pages) inside a test</li>
<li>green/red color mode</li>
<li>select or exclude tests cases using a regex</li>
<li>support normal <a class="reference"
href="http://pyunit.sourceforge.net/">pyUnit</a> test</li>
<li>support <a class="reference"
href="http://docs.python.org/lib/module-doctest.html">doctest</a>
from a plain text file or embedded in python docstring</li>
</ul>
</li>
<li>Turn a functional test into a load test: just by invoking the bench runner
you can identify scalability and performance problems.</li>
<li>Detailed bench reports in ReST or HTML (and PDF via ps2pdf)
containing:<ul>
<li>the bench configuration</li>
<li>tests, pages, requests stats and charts.</li>
<li>the 5 slowest requests.</li>
<li>servers cpu usage, load average, memory/swap usage and network traffic
charts.</li>
<li>an http error summary list</li>
</ul>
</li>
<li>Easy test customization using a configuration file or command line options.</li>
<li>
Easy test creation using
<a class="reference"
href="http://hathawaymix.org/Software/TCPWatch/">TCPWatch</a> as proxy
recorder, so you can use your web browser and produce a
<a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a>
test automatically.
</li>
<li>Provides web assertion helpers.</li>
<li>Provides a funkload.CPSTestCase to ease <a class="reference"
href="http://www.zope.org/">Zope</a> and <a class="reference"
href="http://www.nuxeo.com/">Nuxeo</a> <a class="reference"
href="http://www.cps-project.org/">CPS</a> testing.
</li>
<li>Easy to install (<a class="reference"
href="http://peak.telecommunity.com/DevCenter/EasyInstall">EasyInstall</a>)
and use, see examples in the <a class="reference"
href="http://svn.nuxeo.org/trac/pub/browser/funkload/trunk/funkload/demo/">demo</a>
folder.
</li>
</ul>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id16"
id="where-to-find-funkload"
name="where-to-find-funkload">1.2 Where to find FunkLoad ?</a></h2>
<p>Either:</p>
<ul>
<li>
<p class="first">Latest stable package using <a class="reference"
href="http://peak.telecommunity.com/DevCenter/EasyInstall">EasyInstall</a>:
</p>
<pre class="literal-block">
sudo easy_install -U funkload
</pre>
</li>
<li><p class="first"><a class="reference"
href="http://peak.telecommunity.com/DevCenter/EasyInstall">EasyInstall</a>
the latest snapshot
</p>
<pre class="literal-block">
sudo easy_install -f http://funkload.nuxeo.org/snapshots/ funkload
</pre>
</li>
<li><p class="first">Bleeding edge <a class="reference"
href="http://svn.nuxeo.org/pub/funkload/trunk/#egg=funkload-dev">svn sources</a>:</p>
<pre class="literal-block">
easy_install -eb . funkload==dev
# or
svn co http://svn.nuxeo.org/pub/funkload/trunk funkload
</pre>
</li>
</ul>
<p>See <a class="reference" href="CHANGES.html">CHANGES</a> file for information about distribution contents.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id17" id="installation"
name="installation">1.3 Installation</a></h2>
<p>See the <a class="reference" href="INSTALL.html">INSTALL</a> file for
requirement and installation.
</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id18" id="examples"
name="examples">1.4 Examples</a></h2>
<p>See the <a class="reference"
href="http://svn.nuxeo.org/trac/pub/browser/funkload/trunk/funkload/demo/">demo</a>
folder contents and a <a class="reference"
href="http://funkload.nuxeo.org/report-example.pdf">report</a> example.</p>
<p>For package installed with easy_install you need to run
<tt class="docutils literal"><span class="pre">fl-install-demo</span></tt>
to extract the demo examples.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id19" id="documentation"
name="documentation">1.5 Documentation</a></h2>
<p>This page is the main <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a>
documentation, there are also:</p>
<ul class="simple">
<li><a class="reference" href="CHANGES.html">CHANGES</a> for information about
distribution contents.
</li>
<li><a class="reference" href="INSTALL.html">INSTALL</a> for requirement and installation.
</li>
<li><a class="reference" href="api/index.html">API</a> documentation generated with
<a class="reference" href="http://epydoc.sourceforge.net/">epydoc</a>.
</li>
<li><a class="reference"
href="http://blogs.nuxeo.com/sections/blogs/fermigier/2005_11_17_slides-introducing">SLIDES</a>
introducing <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a>.
</li>
</ul>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id20" id="credits"
name="credits">1.6 Credits</a></h2>
<p>Thanks to Frank Cohen's <a class="reference" href="http://www.pushtotest.com/">TestMaker</a>
framework and Richard Jones <a class="reference"
href="http://mechanicalcat.net/tech/webunit/">webunit</a>
package.</p>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id21" id="test-runner"
name="test-runner">2 Test runner</a></h1>
<p>A <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> test can
be used like a standard unittest using a unittest.main()
and a 'python MyFile.py'.</p>
<p>To ease testing <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a>
come with an advanced test runner to override
the static configuration file.</p>
<p>The <tt class="docutils literal"><span class="pre">loop-on-pages</span></tt> option
enable to check response time of some specific
pages inside a test without changing the script, which make easy to tune a
page in a complex context. Use the <tt class="docutils literal"><span
class="pre">debug</span></tt> option to find the page numbers.</p>
<p>Note that <tt class="docutils literal"><span class="pre">fl-run-test</span></tt>
can be used to launch normal unittest.TestCase and
(if you use python2.4) <a class="reference"
href="http://docs.python.org/lib/module-doctest.html">doctest</a> in a
plain text file or embedded in a python
docstring. The <tt class="docutils literal"><span class="pre">--debug</span></tt>
option makes doctests verbose.</p>
<div class="section">
<h2><a class="toc-backref" href="#id22" id="usage"
name="usage">2.1 Usage</a></h2>
<pre class="literal-block">
fl-run-test [options] file [class.method|class|suite] [...]
</pre>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id23" id="id1" name="id1">2.2 Examples</a></h2>
<pre class="literal-block">
fl-run-test myFile.py
Run all tests (including doctest with python2.4).
fl-run-test myFile.py test_suite
Run suite named test_suite.
fl-run-test myFile.py MyTestCase.testSomething
Run a single test MyTestCase.testSomething.
fl-run-test myFile.py MyTestCase
Run all 'test*' test methods in MyTestCase.
fl-run-test myFile.py MyTestCase -u http://localhost
Same against localhost.
fl-run-test myDocTest.txt
Run doctest from plain text file (requires python2.4).
fl-run-test myDocTest.txt -d
Run doctest with debug output (requires python2.4).
fl-run-test myfile.py -V
Run default set of tests and view in real time each
page fetch with firefox.
fl-run-test myfile.py MyTestCase.testSomething -l 3 -n 100
Run MyTestCase.testSomething, reload one hundred
time the page 3 without concurrency and as fast as
possible. Output response time stats. You can loop
on many pages using slice -l 2:4.
fl-run-test myFile.py -e [Ss]ome
Run all tests that match the regex [Ss]ome.
fl-run-test myFile.py -e '!foo$'
Run all tests that does not ends with foo.
fl-run-test myFile.py --list
List all the test names.
fl-run-test -h
More options.
</pre>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id24" id="options" name="options">2.3 Options</a></h2>
<pre class="literal-block">
--version show program's version number and exit
--help, -h show this help message and exit
--quiet, -q Minimal output.
--verbose, -v Verbose output.
--debug, -d FunkLoad and doctest debug output.
--debug-level=DEBUG_LEVEL
Debug level 2 is more verbose.
--url=MAIN_URL, -uMAIN_URL
Base URL to bench without ending '/'.
--sleep-time-min=FTEST_SLEEP_TIME_MIN, -mFTEST_SLEEP_TIME_MIN
Minumum sleep time between request.
--sleep-time-max=FTEST_SLEEP_TIME_MAX, -MFTEST_SLEEP_TIME_MAX
Maximum sleep time between request.
--dump-directory=DUMP_DIR
Directory to dump html pages.
--firefox-view, -V Real time view using firefox, you must have a running
instance of firefox in the same host.
--no-color Monochrome output.
--loop-on-pages=LOOP_STEPS, -lLOOP_STEPS
Loop as fast as possible without concurrency on pages
expect a page number or a slice like 3:5. Output some
statistics.
--loop-number=LOOP_NUMBER, -nLOOP_NUMBER
Number of loop.
--accept-invalid-links Do not fail if css/image links are not reachable.
--simple-fetch Don't load additional links like css or images when
fetching an html page.
--stop-on-fail Stop tests on first failure or error.
--regex=REGEX, -eREGEX The test names must match the regex.
--list Just list the test names.
</pre>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id25" id="benching" name="benching">3 Benching</a></h1>
<p>The same FunkLaod test can be turned into a load test, just by invoking the
bench runner <tt class="docutils literal"><span class="pre">fl-run-bench</span></tt>.</p>
<div class="section">
<h2><a class="toc-backref" href="#id26" id="principle" name="principle">3.1 Principle</a></h2>
<p>Here are some definitions used in bench mode:</p>
<ul class="simple">
<li>CUs: Concurrent Users, which is the number of threads.</li>
<li>STPS: Average of Successful Tests Per Second during a cycle.</li>
<li>SPPS: Average of Successfully Page Per Second during a cycle.</li>
<li>RPS: Average Request Per Second, successfully or not.</li>
<li>max[STPS|SPPS|RPS]: maximum of STPS|SPPS|RPS for a cycle.</li>
</ul>
<div class="section">
<h3><a class="toc-backref" href="#id27" id="page" name="page">Page</a></h3>
<p>A page is an http get/post request with associated sub requests like
redirects, images or links (css, js files). This is what users see as a
single page.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id28" id="test" name="test">Test</a></h3>
<p>A test is made with 3 methods: setUp/test_name/tearDown. During the test_name
method each get/post request is called a page.</p>
<pre class="literal-block">
[setUp][page 1] [page 2] ... [page n] [tearDown]
======================================================> time
<----------------------------------> test method
<--> sleeptime_min to sleeptime_max
<-----> page 1 connection time
</pre>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id29" id="cycle" name="cycle">Cycle</a></h3>
<p>A cycle is a load of n concurrents test during a 'duration' period.
Threads are launched every 'startupdelay' seconds, each thread executes
test in a loop.</p>
<p>Once all threads have been started we start to record stats.</p>
<p>Only tests that end during the 'duration' period are taken into account
for the test stats (in the representation below test like [---X are not
take into account).</p>
<p>Only pages and requests that finish during the 'duration' are taken into
account for the request and pages statistic</p>
<p>Before a cycle a setUpCycle method is called, after a cycle a tearDownCycle
method is called, you can use these methods to test differents server
configuration for each cycle.</p>
<pre class="literal-block">
Threads
^
|
|
|n [---test--] [--------] [--|---X
|...
| | |
|2 [------|--] [--------] [-------] |
| | |
|1 [------X | [--------] [-------] [--|--X
| | |
|[setUpCycle] | | [tearDownCycle]
===========================================================> time
<------ cycle duration ------->
<----- staging -----> <---- staging ----->
<-> startupdelay <---> sleeptime
</pre>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id30" id="cycles" name="cycles">Cycles</a></h3>
<p><a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> can execute many cycles with different number of CUs, this way you
can find easily the maximum number of users that your application can
handle.</p>
<p>Running n cycles with the same CUs is a good way to see how the application
handles a writing test over time.</p>
<p>Running n cycles with the same CUs with a reading test and a setUpCycle that
change the application configuration will help you to find the right tuning.</p>
<pre class="literal-block">
cvus = [n1, n2, ...]
Threads
^
|
|
|n2 __________
| / \
| / \
|n1 _________ / \
| / \ / \
| / \ / \
| / \ / \
==================================================> time
<-------> duration <-------->
<-----> cycle sleep time
</pre>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id31" id="bench-runner" name="bench-runner">3.2 Bench runner</a></h2>
<div class="section">
<h3><a class="toc-backref" href="#id32" id="id2" name="id2">Usage</a></h3>
<pre class="literal-block">
fl-run-bench [options] file class.method
</pre>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id33" id="id3" name="id3">Examples</a></h3>
<pre class="literal-block">
fl-run-bench myFile.py MyTestCase.testSomething
Bench MyTestCase.testSomething using MyTestCase.conf.
fl-run-bench -u http://localhost:8080 -c 10:20 -d 30 myFile.py MyTestCase.testSomething
Bench MyTestCase.testSomething on localhost:8080
with 2 cycles of 10 and 20 users during 30s.
fl-run-bench -h
More options.
</pre>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id34" id="id4" name="id4">Options</a></h3>
<pre class="literal-block">
--version show program's version number and exit
--help, -h show this help message and exit
--url=MAIN_URL, -uMAIN_URL
Base URL to bench.
--cycles=BENCH_CYCLES, -cBENCH_CYCLES
Cycles to bench, this is a list of number of virtual
concurrent users, to run a bench with 3 cycles with 5,
10 and 20 users use: -c 2:10:20
--duration=BENCH_DURATION, -DBENCH_DURATION
Duration of a cycle in seconds.
--sleep-time-min=BENCH_SLEEP_TIME_MIN, -mBENCH_SLEEP_TIME_MIN
Minimum sleep time between request.
--sleep-time-max=BENCH_SLEEP_TIME_MAX, -MBENCH_SLEEP_TIME_MAX
Maximum sleep time between request.
--startup-delay=BENCH_STARTUP_DELAY, -sBENCH_STARTUP_DELAY
Startup delay between thread.
--no-color Monochrome output.
--accept-invalid-links Do not fail if css/image links are not reachable.
--simple-fetch Don't load additional links like css or images when
fetching an html page.
</pre>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id35" id="tips" name="tips">3.3 Tips</a></h2>
<p>Here are few remarks/advices to obtain workable metrics.</p>
<ul>
<li><p class="first">Since it uses significant CPU resources, make sure that performance limits
are not hit by <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> before your server's limit is reached.
Check this by launching a bench from another host.</p>
</li>
<li><p class="first">Having a cycle with one user gives a usefull reference.</p>
</li>
<li><p class="first">A bench is composed of a benching test (or scenario) run many times. A good
benching test should not be too long so you have a higher testing rate (that
is, more benching tests can come to their end).</p>
</li>
<li><p class="first">The cycle duration for the benching test should be long enough.
Around 5 times the duration of a single benching test is a value that is
usually a safe bet. You can obtain this duration of a single benching test by
running <tt class="docutils literal"><span class="pre">fl-run-test</span> <span class="pre">myfile.py</span> <span class="pre">MyTestCase.testSomething</span></tt>.</p>
<p>Rationale : Normally a cycle duration of a single benching test should be
enough. But from the testing platform side if there are more than one
concurrent user, there are many threads to start and it takes some time. And on
from the tested platform side it is common that a benching test will last
longer and longer as the server is used by more and more users.</p>
</li>
<li><p class="first">You should use many cycles with the same step interval to produce readable
charts (1:10:20:30:40:50:60 vs 1:10:100)</p>
</li>
<li><p class="first">A benching test must have the same number of page and in the same
order.</p>
</li>
<li><p class="first">Use a Makefile to make reproductible bench.</p>
</li>
<li><p class="first">There is no debug option while doing a bench (since this would be illegible
with all the threads). So, if a bench fails (that is using <cite>fl-run-bench</cite>),
use <tt class="docutils literal"><span class="pre">fl-run-test</span> <span class="pre">-d</span></tt> to debug.</p>
</li>
<li><p class="first">Using <cite>fl-record</cite> is very easy and very fast to create a scenario. But since
it doesn't support HTTPS, the good practise is to first record a scenario
with <cite>fl-record</cite> on HTTP, and then change the <cite>url</cite> back to <cite>https</cite> in your
FunkLoad test configuration file.</p>
</li>
<li><p class="first">Always use description in post/get/xmlrpc, this improves the
readability of the report.</p>
</li>
</ul>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id36" id="bench-report" name="bench-report">4 Bench report</a></h1>
<p>To produce an HTML or ReST report you need to invoke the <tt class="docutils literal"><span class="pre">fl-build-report</span></tt>,
you can easily produce PDF report using Firefox 'Print To File' in
PostScript then use the ps2pdf converter.</p>
<div class="section">
<h2><a class="toc-backref" href="#id37" id="id5" name="id5">4.1 Usage</a></h2>
<pre class="literal-block">
fl-build-report [options] xmlfile
</pre>
<p><tt class="docutils literal"><span class="pre">fl-build-report</span></tt> analyze a <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> bench xml result file and output a
report.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id38" id="id6" name="id6">4.2 Examples</a></h2>
<pre class="literal-block">
fl-build-report funkload.xml
ReST rendering into stdout.
fl-build-report --html -o /tmp funkload.xml
Build an HTML report in /tmp.
fl-build-report -h
More options.
</pre>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id39" id="id7" name="id7">4.3 Options</a></h2>
<pre class="literal-block">
--version show program's version number and exit
--help, -h show this help message and exit
--html, -H Produce an html report.
--output-directory=OUTPUT_DIR, -oOUTPUT_DIR
Directory to store reports.
Note that you can preview the report for cycles that have been done while
the bench is still running by invoking the above command.
</pre>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id40" id="test-recorder" name="test-recorder">5 Test Recorder</a></h1>
<div class="section">
<h2><a class="toc-backref" href="#id41" id="recording-a-new-funkload-test" name="recording-a-new-funkload-test">5.1 Recording a new FunkLoad test</a></h2>
<p>Starting with <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> 1.3.0 you can use <tt class="docutils literal"><span class="pre">fl-record</span></tt> to record your
navigator activity, this requires the <a class="reference" href="http://hathawaymix.org/Software/TCPWatch/">TCPWatch</a> python proxy see <a class="reference" href="INSTALL.html">INSTALL</a>
for information on how to install <a class="reference" href="http://hathawaymix.org/Software/TCPWatch/">TCPWatch</a>.</p>
<ol class="arabic">
<li><p class="first">Start the recorder:</p>
<pre class="literal-block">
fl-record basic_navigation
</pre>
</li>
</ol>
<blockquote>
<p>This will output something like this:</p>
<pre class="literal-block">
Hit Ctrl-C to stop recording.
HTTP proxy listening on :8090
Recording to directory /tmp/tmpaYDky9_funkload.
</pre>
</blockquote>
<ol class="arabic simple" start="2">
<li>Setup your browser proxy and play your scenario</li>
</ol>
<blockquote>
<ul>
<li><p class="first">in Firefox: Edit > Preferencies > General; Connection Settings set
<cite>localhost:8090</cite> as your HTTP proxy</p>
</li>
<li><p class="first">Play your scenario using your navigator</p>
</li>
<li><p class="first">Hit Ctrl-C to stop recording:</p>
<pre class="literal-block">
^C
# Saving uploaded file: foo.png
# Saving uploaded file: bar.pdf
Creating script: ./test_BasicNavigation.py.
Creating configuration file: ./BasicNavigation.conf.
</pre>
</li>
</ul>
</blockquote>
<ol class="arabic" start="3">
<li><p class="first">Replay you scenario:</p>
<pre class="literal-block">
fl-run-test -dV test_BasicNavigation.py
</pre>
</li>
</ol>
<blockquote>
You should see all the steps on your navigator.</blockquote>
<ol class="arabic simple" start="4">
<li>Implement the dynamic part and assertion</li>
</ol>
<blockquote>
<ul class="simple">
<li>Code the dynamic part like getting new url of a created document</li>
<li>Add assertion using <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> helpers</li>
<li>Use a credential server if you want to make a bench with different users
or simply don't want to hard code your login/password.</li>
</ul>
</blockquote>
<p>Note that <tt class="docutils literal"><span class="pre">fl-record</span></tt> works fine with multi-part encoded form and file upload
but will failed to record https session.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id42" id="the-fl-record-command" name="the-fl-record-command">5.2 The fl-record command</a></h2>
<div class="section">
<h3><a class="toc-backref" href="#id43" id="id8" name="id8">Usage</a></h3>
<pre class="literal-block">
fl-record [options] [test_name]
fl-record launch a TCPWatch_ proxy and record activities, then output
a FunkLoad script or generates a FunkLoad unit test if test_name
is specified. The default proxy port is 8090.
Note that tcpwatch.py executable must be accessible from your env.
</pre>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id44" id="id9" name="id9">Examples</a></h3>
<pre class="literal-block">
fl-record foo_bar
Run a proxy and create a FunkLoad test case,
generates test_FooBar.py and FooBar.conf file.
To test it: fl-run-test -dV test_FooBar.py
fl-record -p 9090
Run a proxy on port 9090, output script to stdout.
fl-record -i /tmp/tcpwatch
Convert a tcpwatch capture into a script.
</pre>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id45" id="id10" name="id10">Options</a></h3>
<pre class="literal-block">
--version show program's version number and exit
--help, -h show this help message and exit
--verbose, -v Verbose output
--port=PORT, -pPORT The proxy port.
--tcp-watch-input=TCPWATCH_PATH, -iTCPWATCH_PATH
Path to an existing tcpwatch capture.
</pre>
</div>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id46" id="credential-server" name="credential-server">6 Credential server</a></h1>
<p>If you are writing a bench that requires to be logged with different users
<a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> provides an xmlrpc credential server to serve login/pwd between the
different threads.</p>
<p>It requires 2 files (like unix /etc/passwd and /etc/group) the password file
have the following format:</p>
<pre class="literal-block">
login1:pwd1
...
</pre>
<p>The group file format is:</p>
<pre class="literal-block">
group1:user1, user2
group2:user2
# you can split group declaration
group1:user3
...
</pre>
<p>Setup a configuration file like in the <a class="reference" href="http://svn.nuxeo.org/trac/pub/browser/funkload/trunk/funkload/demo/">demo</a>/cmf folder, then start the
credential server:</p>
<pre class="literal-block">
fl-credential-ctl credential.conf start
</pre>
<p>More options:</p>
<pre class="literal-block">
fl-credential-ctl --help
</pre>
<p>See the funkload-demo/cmf example for a credential configuration file.</p>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id47" id="monitor-server"
name="monitor-server">7 Monitor server</a></h1>
<p>If you want to monitor a linux server health during the bench, you have to
run a monitor xmlrpc server on the target server, this require to install
the <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> package.</p>
<p>On the server side you need to install the <a class="reference"
href="http://funkload.nuxeo.org/">FunkLoad</a> tool then launch the
server using a configuration file (example in the <a class="reference"
href="http://svn.nuxeo.org/trac/pub/browser/funkload/trunk/funkload/demo/">demo</a>/simple
folder.):</p>
<pre class="literal-block">
fl-monitor-ctl monitor.conf start
# more info
fl-monitor-ctl --help
</pre>
<p>On the bench host side setup your test configuration like this:</p>
<pre class="literal-block">
[monitor]
hosts = server.to.test.com
[server.to.test.com]
description = The web server
port = 8008
</pre>
<p>Then run the bench, the report will include server stats.</p>
<p>Note that you can monitor multiple hosts and that the monitor is linux
specific.</p>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id48" id="the-funkloadtestcase" name="the-funkloadtestcase">8 The FunkLoadTestCase</a></h1>
<p>FunkLoadTestCase extends the <a class="reference" href="http://pyunit.sourceforge.net/">pyUnit</a> unittest.TestCase with browser
capabilities, configuration file helpers and assertions helpers. <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a>
provides also some tools to generate random inputs and communicate with
credential servers.</p>
<p>Here is an overview of the api, you can find more on</p>
<div class="section">
<h2><a class="toc-backref" href="#id49" id="browser-api" name="browser-api">8.1 Browser API</a></h2>
<div class="section">
<h3><a class="toc-backref" href="#id50" id="get" name="get">get</a></h3>
<pre class="literal-block">
get(url, params=None, description=None, ok_codes=None)
</pre>
<p>This emulates a browser http GET link. It will fetch the url, submits
appropriate cookies, follow redirection, register new cookies, load css and
javascript.</p>
<p>It also simulates a browser cache by not reloading a css, a javascript or an
image twice.</p>
<p>Note that this is an emulation with some limitation:</p>
<ul class="simple">
<li>It is single threaded (it loads images one after the other)</li>
<li>It does not interpret javascript</li>
<li>See <a class="reference" href="http://svn.nuxeo.org/trac/pub/report/12">trac</a> tickets that starts with <cite>Browser:</cite> for other limitations</li>
</ul>
<p>This method returns a <a class="reference" href="http://mechanicalcat.net/tech/webunit/">webunit</a> HTTPResponse.</p>
<p>Parameters:</p>
<ul class="simple">
<li><em>url</em> a valid url</li>
<li><em>params</em> a dico of parameters that going to be append to the url like
<cite>url?key1=value1&...</cite></li>
<li><em>description</em> is used on the bench report to describe the user action</li>
<li><em>ok_codes</em> is a list of http expected code like [200:301] if the http
response is not in the list <cite>get</cite> will raise a test failure exception,
if not provided assume that the default list is [200, 301, 302].</li>
</ul>
<p>Note that if the <em>url</em> already contains encoded parameters you should not
use the <em>params</em> parameter.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id51" id="post" name="post">post</a></h3>
<pre class="literal-block">
post(url, params=None, description=None, ok_codes=None)
</pre>
<p>Same interface than the get() but it uses a http post method.
You can upload a file by setting a params like this:</p>
<pre class="literal-block">
from webunit.utility import Upload
params['file_up'] = Upload('/tmp/foo.txt')
</pre>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id52" id="exists" name="exists">exists</a></h3>
<pre class="literal-block">
exists(url, params=None, description="Checking existence")
</pre>
<p>Return True if the http response code is 200, 301 or 302, and return False if
http code is 404 or 503, other codes will raise a test failure exception.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id53" id="setbasicauth" name="setbasicauth">setBasicAuth</a></h3>
<pre class="literal-block">
setBasicAuth(login, password)
</pre>
<p>Next requests will use the http basic authentication.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id54" id="clearbasicauth" name="clearbasicauth">clearBasicAuth</a></h3>
<pre class="literal-block">
clearBasicAuth()
</pre>
<p>Remove basic auth credential set by setBasicAuth.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id55" id="setuseragent" name="setuseragent">setUserAgent</a></h3>
<pre class="literal-block">
setUserAgent(agent)
</pre>
<p>New in 1.3.0. version.</p>
<p>Set a <tt class="docutils literal"><span class="pre">User-Agent</span></tt> http header for the next requests, the default browser
behaviour is to use the agent defined in the configuration file under
<tt class="docutils literal"><span class="pre">[main]</span>
<span class="pre">user_agent</span></tt> or to use the default
<tt class="docutils literal"><span class="pre">FunkLoad/version</span></tt>
string. Using this method enable to change the user agent during a test
case.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id56" id="addheader" name="addheader">addHeader</a></h3>
<pre class="literal-block">
addHeader(key, value)
</pre>
<p>New in 1.3.0. version.</p>
<p>Add an http header for the next requests.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id57" id="clearheaders" name="clearheaders">clearHeaders</a></h3>
<pre class="literal-block">
clearHeaders()
</pre>
<p>New in 1.3.0. version.</p>
<p>Remove all headers previously added by <a class="reference" href="#addheader">addHeader</a> or <a class="reference" href="#setuseragent">setUserAgent</a>,
and remove the referer as well.</p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id58" id="xml-rpc-api" name="xml-rpc-api">8.2 XML RPC API</a></h2>
<p>You can test or bench xmlrpc services using the following API.</p>
<div class="section">
<h3><a class="toc-backref" href="#id59" id="xmlrpc" name="xmlrpc">xmlrpc</a></h3>
<pre class="literal-block">
xmlrpc(url, method_name, params=None, description=None)
</pre>
<p>Call the <tt class="docutils literal"><span class="pre">method_name</span></tt> at <tt class="docutils literal"><span class="pre">url</span></tt> using xmlrpclib. You can use the
<a class="reference" href="#setbasicauth">setBasicAuth</a> method before to handle the http basic authentication. Note
that due to xmlrpclib limitation you can not use an http proxy.</p>
<p>Parameters:</p>
<ul class="simple">
<li><em>url</em> the url of the xmlrpc server</li>
<li><em>method_name</em> the name of the procedure to call</li>
<li><em>params</em> a list of parameters to pass to the method</li>
<li><em>description</em> is used on the bench report to describe the action</li>
</ul>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id60" id="assertion-helpers-api" name="assertion-helpers-api">8.3 Assertion helpers API</a></h2>
<p><a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> uses the unittest assertion (<tt class="docutils literal"><span class="pre">assert_</span></tt>, <tt class="docutils literal"><span class="pre">assertEquals</span></tt>,
<tt class="docutils literal"><span class="pre">fail</span></tt>, ...), but provides some methods to check the http response.
After fetching a page you can use the following methods.</p>
<div class="section">
<h3><a class="toc-backref" href="#id61" id="getlasturl" name="getlasturl">getLastUrl</a></h3>
<pre class="literal-block">
getLastUrl()
</pre>
<p>Return the last accessed page url taking care of redirects.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id62" id="getlastbaseurl" name="getlastbaseurl">getLastBaseUrl</a></h3>
<pre class="literal-block">
getLastBaseUrl()
</pre>
<p>Return the <base /> href value of the last accessed page.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id63" id="listhref" name="listhref">listHref</a></h3>
<pre class="literal-block">
listHref(pattern=None)
</pre>
<p>Return a list of href anchor url present in the last html response,
filtering href using the <tt class="docutils literal"><span class="pre">pattern</span></tt>
regex if present.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id64" id="getbody" name="getbody">getBody</a></h3>
<pre class="literal-block">
getBody()
</pre>
<p>Return the last response content.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id65" id="the-response-object"
name="the-response-object">The response object</a></h3>
<p>The response returned by a get or post are <a class="reference"
href="http://mechanicalcat.net/tech/webunit/">webunit</a> HTTPResponse object</p>
<pre class="literal-block">
response = self.get(url)
print "http response code %s" % response.code
print "http header location %s" % response.headers['location']
self.assert_('HTML' in response.body)
</pre>
<pre class="literal-block">
response.getDOM().getByName('h1')
</pre>
<p>getDOM return a SimpleDOM interface of the fetched html page, see the
<a class="reference" href="http://mechanicalcat.net/tech/webunit/">webunit</a> SimpleDOM api instructions for details.</p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id66" id="configuration-file-api" name="configuration-file-api">8.4 Configuration file API</a></h2>
<p>A FunkLoadTestCase class uses a configuration file to setup variable
configuration, like the base server url to be tested, the test description,
credential access, logging files and other test specific parameters. The test
configuration file have the same name of the FunkLoadTestCase with a '.conf'
extension. See documented examples in the <a class="reference" href="http://svn.nuxeo.org/trac/pub/browser/funkload/trunk/funkload/demo/">demo</a> folder (<tt class="docutils literal"><span class="pre">fl-install-demo</span></tt>).</p>
<div class="section">
<h3><a class="toc-backref" href="#id67" id="conf-get" name="conf-get">conf_get</a></h3>
<pre class="literal-block">
conf_get(section, key, default=_marker)
</pre>
<p>Return an entry from the configuration file. Note that the entry may be
overriden by a command line option.</p>
<p>Parameters:</p>
<ul class="simple">
<li><em>section</em> the section in the configuration file.</li>
<li><em>key</em> the key.</li>
<li><em>default</em> a default value.</li>
</ul>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id68" id="conf-getint" name="conf-getint">conf_getInt</a></h3>
<p>Return an integer.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id69" id="conf-getfloat" name="conf-getfloat">conf_getFloat</a></h3>
<p>Return a float.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id70" id="conf-getlist" name="conf-getlist">conf_getList</a></h3>
<p>Additional parameter:</p>
<ul class="simple">
<li><em>separator</em> the default separator is a colon ':'.</li>
</ul>
<p>Return a list</p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id71" id="logging" name="logging">8.5 Logging</a></h2>
<p>A FunkLoadTestCase store its results in an xml file (like request and test
result) and put other log information into a text log and/or output to the
console.</p>
<div class="section">
<h3><a class="toc-backref" href="#id72" id="logd" name="logd">logd</a></h3>
<pre class="literal-block">
logd(message)
</pre>
<p>Debug log message</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id73" id="logi" name="logi">logi</a></h3>
<pre class="literal-block">
logi(message)
</pre>
<p>Information log message</p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id74" id="lipsum-api" name="lipsum-api">8.6 Lipsum API</a></h2>
<p>To generate dummy document contents you can use the funkload.Lipsum api,
this is a very simple "Lorem ipsum" generator.</p>
<p>You can see some examples by doing:</p>
<pre class="literal-block">
python -c "from funkload.Lipsum import main; main()"
</pre>
<div class="section">
<h3><a class="toc-backref" href="#id75" id="lipsum" name="lipsum">Lipsum</a></h3>
<pre class="literal-block">
from funkload.Lipsum import Lipsum
lipsum = Lipsum(vocab=V_ASCII, chars=CHARS, sep=SEP)
</pre>
<p>Parameters:</p>
<ul class="simple">
<li><em>vocab</em> a list of word, Lipsum provide 3 lists V_ASCII, V_DIAC, V_8859_15</li>
<li><em>chars</em> the list of char used to build an identifier</li>
<li><em>sep</em> some separators used in sentences like coma, question mark ...</li>
</ul>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id76" id="getword" name="getword">getWord</a></h3>
<pre class="literal-block">
lipsum.getWord()
</pre>
<p>Return a random word from the vocabulary.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id77" id="getuniqword" name="getuniqword">getUniqWord</a></h3>
<pre class="literal-block">
lipsum.getUniqWord(length_min=None, length_max=None):
</pre>
<p>Generate a kind of uniq id.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id78" id="getsubject" name="getsubject">getSubject</a></h3>
<pre class="literal-block">
lipsum.getSubject(length=5, prefix=None, uniq=False,
length_min=None, length_max=None)
</pre>
<p>Return a subject of length word.</p>
<p>Parameters:</p>
<ul class="simple">
<li><em>length</em> the number of words in the subject</li>
<li><em>prefix</em> a prefix to add at the beginning of a the subject</li>
<li><em>uniq</em> add an uniq identifier in the subject</li>
<li><em>length_min/max</em> the words length is a random between min and max</li>
</ul>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id79" id="getsentence" name="getsentence">getSentence</a></h3>
<pre class="literal-block">
lipsum.getSentence()
</pre>
<p>Return a sentence with some separators and and a ending point.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id80" id="getparagraph" name="getparagraph">getParagraph</a></h3>
<pre class="literal-block">
lipsum.getParagraph(length=4)
</pre>
<p>Return a paragraph of length sentences.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id81" id="getmessage" name="getmessage">getMessage</a></h3>
<pre class="literal-block">
lipsum.getMessage(length=7)
</pre>
<p>Return a message with length Paragraphs.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id82" id="getphonenumber" name="getphonenumber">getPhoneNumber</a></h3>
<pre class="literal-block">
lipsum.getPhoneNumber(lang="fr", format="medium")
</pre>
<p>Return a random phone number.</p>
<p>Parameters:</p>
<ul class="simple">
<li><em>lang</em> can be fr or en_US</li>
<li><em>format</em> can be short, medium or long</li>
</ul>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id83" id="getaddress" name="getaddress">getAddress</a></h3>
<pre class="literal-block">
lipsum.getAddress(lang="fr")
</pre>
<p>Return a random address.</p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id84" id="utils"
name="utils">8.7 Utils</a></h2>
<p>To communicate with <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a>
services like the credential server, there are
some wrappers in the utils module.</p>
<div class="section">
<h3><a class="toc-backref" href="#id85" id="xmlrpc-get-credential"
name="xmlrpc-get-credential">xmlrpc_get_credential</a></h3>
<pre class="literal-block">
from funkload.utils import xmlrpc_get_credential
xmlrpc_get_credential(credential_host, credential_port, group=None)
</pre>
<p>Return a tuple login, password of a user that belong to group if specified.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id86" id="xmlrpc-list-groups"
name="xmlrpc-list-groups">xmlrpc_list_groups</a></h3>
<p>List groups name served by the credential server.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id87" id="xmlrpc-list-credentials"
name="xmlrpc-list-credentials">xmlrpc_list_credentials</a></h3>
<p>List all login/password served by the credential server.</p>
</div>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id88" id="funkloaddoctest"
name="funkloaddoctest">9 FunkLoadDocTest</a></h1>
<p>Since <a class="reference" href="http://funkload.nuxeo.org/">FunkLoad</a> 1.5
you can use funkload easily from a <a class="reference"
href="http://docs.python.org/lib/module-doctest.html">doctest</a>:</p>
<pre class="literal-block">
>>> from funkload.FunkLoadDocTest import FunkLoadDocTest
>>> fl = FunkLoadDocTest()
>>> response = fl.get('http://localhost/')
>>> 'HTML' in response.body
True
>>> response
<response url="http://127.0.0.1:80/" code="200" message="OK" />
</pre>
<p><a class="reference" href="#funkloaddoctest">FunkLoadDocTest</a> exposes the same API than <a class="reference" href="#the-funkloadtestcase">The FunkLoadTestCase</a>.</p>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id89" id="other-test-cases" name="other-test-cases">10 Other Test Cases</a></h1>
<div class="section">
<h2><a class="toc-backref" href="#id90" id="the-zopetestcase" name="the-zopetestcase">10.1 The ZopeTestCase</a></h2>
<p>This class extends the FunkLoadTestCase providing common <a class="reference" href="http://www.zope.org/">Zope</a> tasks.</p>
<div class="section">
<h3><a class="toc-backref" href="#id91" id="zoperestart" name="zoperestart">zopeRestart</a></h3>
<pre class="literal-block">
zopeRestart(zope_url, admin_id, admin_pwd, time_out=600)
</pre>
<p>Stop and Start the <a class="reference" href="http://www.zope.org/">Zope</a> server.</p>
<p>Parameters:</p>
<ul class="simple">
<li><em>zope_url</em> the zope url.</li>
<li><em>admin_id</em> and <em>admin_pwd</em> the zope admin credential.</li>
<li><em>time_out</em> maximum time to wait until the zope server restart.</li>
</ul>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id92" id="zopepackzodb" name="zopepackzodb">zopePackZodb</a></h3>
<pre class="literal-block">
zopePackZodb(zope_url, admin_id, admin_pwd, database="main", days=0)
</pre>
<p>Pack a zodb database.</p>
<p>Parameters:</p>
<ul class="simple">
<li><em>database</em> the database to pack.</li>
<li><em>days</em> removing previous revision that are older than <em>days</em> ago</li>
</ul>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id93" id="zopeflushcache" name="zopeflushcache">zopeFlushCache</a></h3>
<pre class="literal-block">
zopeFlushCache(zope_url, admin_id, admin_pwd, database="main")
</pre>
<p>Remove all objects from all ZODB in-memory caches.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id94" id="zopeaddexternalmethod" name="zopeaddexternalmethod">zopeAddExternalMethod</a></h3>
<pre class="literal-block">
zopeAddExternalMethod(parent_url, admin_id, admin_pwd,
method_id, module, function, run_it=True)
</pre>
<p>Add an External method an run it.</p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id95" id="cpstestcase" name="cpstestcase">10.2 CPSTestCase</a></h2>
<p>This class extends the ZopeTestCase providing common <a class="reference" href="http://www.nuxeo.com/">Nuxeo</a> <a class="reference" href="http://www.cps-project.org/">CPS</a> tasks. You
need to import the CPSTestCase that works with your <a class="reference" href="http://www.cps-project.org/">CPS</a> for example
CPS338TestCAse or CPS340TestCase.</p>
<div class="section">
<h3><a class="toc-backref" href="#id96" id="cpscreatesite" name="cpscreatesite">cpsCreateSite</a></h3>
<pre class="literal-block">
cpsCreateSite(admin_id, admin_pwd,
manager_id, manager_password,
manager_mail, langs=None,
title=None, description=None,
interface="portlets", zope_url=None, site_id=None)
</pre>
<p>Build a new <a class="reference" href="http://www.cps-project.org/">CPS</a> site.</p>
<p>Parameters:</p>
<ul class="simple">
<li><em>admin_id</em> and <em>admin_pwd</em> the zope admin credential.</li>
<li><em>manager_id</em> and <em>manager_pwd</em> the cps manager credential.</li>
<li><em>zope_url</em> the <a class="reference" href="http://www.zope.org/">Zope</a> server url <a class="footnote-reference" href="#id12" id="id11" name="id11">[*]</a>.</li>
<li><em>site_id</em> the <a class="reference" href="http://www.cps-project.org/">CPS</a> site id.</li>
</ul>
<table class="docutils footnote" frame="void" id="id12" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id11" name="id12">[*]</a></td><td>if the zope_url and site_id is not given we guess it using the
server_url</td></tr>
</tbody>
</table>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id97" id="cpslogin" name="cpslogin">cpsLogin</a></h3>
<pre class="literal-block">
cpsLogin(login, password)
</pre>
<p>CPS log in.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id98" id="cpslogout" name="cpslogout">cpsLogout</a></h3>
<p>Logout the user logged in using cpsLogin.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id99" id="cpscreategroup" name="cpscreategroup">cpsCreateGroup</a></h3>
<pre class="literal-block">
cpsCreateGroup(group_name)
</pre>
<p>Create a <a class="reference" href="http://www.cps-project.org/">CPS</a> group.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id100" id="cpsverifygroup" name="cpsverifygroup">cpsVerifyGroup</a></h3>
<pre class="literal-block">
cpsVerifyGroup(group_name)
</pre>
<p>Create a <a class="reference" href="http://www.cps-project.org/">CPS</a> group if not present.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id101" id="cpscreateuser"
name="cpscreateuser">cpsCreateUser</a></h3>
<pre class="literal-block">
cpsCreateUser(user_id=None, user_pwd=None,
user_givenName=None, user_sn=None,
user_email=None, groups=None):
</pre>
<p>Create a <a class="reference" href="http://www.cps-project.org/">CPS</a> users.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id102" id="cpsverifyuser"
name="cpsverifyuser">cpsVerifyUser</a></h3>
<p>Create a <a class="reference" href="http://www.cps-project.org/">CPS</a>
users if not present.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id103" id="cpssetlocalrole"
name="cpssetlocalrole">cpsSetLocalRole</a></h3>
<pre class="literal-block">
cpsSetLocalRole(url, name, role)
</pre>
<p>Grant role to name in url.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id104" id="cpscreatesection"
name="cpscreatesection">cpsCreateSection</a></h3>
<pre class="literal-block">
cpsCreateSection(parent_url, title, description)
</pre>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id105" id="cpscreateworkspace"
name="cpscreateworkspace">cpsCreateWorkspace</a></h3>
<pre class="literal-block">
cpsCreateWorkspace(parent_url, title, description)
</pre>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id106" id="cpscreatedocument"
name="cpscreatedocument">cpsCreateDocument</a></h3>
<pre class="literal-block">
cpsCreateDocument(parent_url)
</pre>
<p>Create a random document in the parent_url container.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id107" id="cpscreatenewsitem"
name="cpscreatenewsitem">cpsCreateNewsItem</a></h3>
<pre class="literal-block">
cpsCreateNewsItem(parent_url)
</pre>
<p>Create a simple news in the parent_url container.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id108" id="cpschangeuilanguage"
name="cpschangeuilanguage">cpsChangeUiLanguage</a></h3>
<pre class="literal-block">
cpsChangeUiLanguage(lang)
</pre>
<p>Change the ui locale selection</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id109" id="cpslistdocumenthref"
name="cpslistdocumenthref">cpsListDocumentHref</a></h3>
<pre class="literal-block">
cpsListDocumentHref(pattern)
</pre>
<p>Return a clean list of document href that matches pattern in the previous
page fetched.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id110" id="cpssearchdocid"
name="cpssearchdocid">cpsSearchDocId</a></h3>
<pre class="literal-block">
cpsSearchDocId(doc_id)
</pre>
<p>Return the list of url that ends with doc_id, using catalog search.</p>
</div>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id111" id="todo-and-bugs"
name="todo-and-bugs">11 Todo and bugs</a></h1>
<ul class="simple">
<li>See the trac tickets: <a class="reference"
href="http://svn.nuxeo.org/trac/pub/report/12">http://svn.nuxeo.org/trac/pub/report/12</a></li>
</ul>
<p>If you want to report a bug or if you think that something is
missing, send me an email.</p>
<!-- Local Variables: -->
<!-- mode: rst -->
<!-- End: -->
<!-- vim: set filetype=rst: -->
</div>
</div>
<div class="footer">
<hr class="footer" />
Generated on: 2007-07-30 08:03 UTC.
</div>
</body>
</html>
|