Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
This lbtest tool is a simple command line interface for loadbooster services. It allows you to load test web applications in terminal or integrate loadbooster into your continuous development.
[sudo] npm install -g lbtest
lbtest configure
Enter your LoadBooster credentials
User Email: <YOUR_ACCOUNT_EMAIL>
API Token: <YOUR_API_TOKEN>
You need NodeJS and NPM to do that. And, you can find your api token in account page
The usage options are simple:
Usage: lbtest [options] [command]
Commands:
configure [options] Configure and validate your API token
run [options] Run a load test based on a CasperJs Script or a single URL
run-test-config [options] <string> Run a load test based on a test config
run-scenario [options] <id> Run a load test based on an user scenario
validate [options] Validate CasperJs Script or a user Scenario
test-config [options] Retrieve your test configs
scenario [options] Retrieve your scenarios
account Show information about your account
help [command] Output help information for this command
Options:
-h, --help output usage information
-V, --version output the version number
There are three sub commands to start a load test.
lbtest run -p 1-100:1 -s ~/casperjs_sample.js
lbtest run -p 1-100:1 -e ~/selenium_html_sample.html
lbtest run -r ireland -p 1-100:1,100:1 --url http://www.example.com
-p,--pattern: Ramp from s(start) to e(end) users in d minutes (s-e:d). i.e. -p 1-100:1,100:2, -p 100:2
-r,--region: california|oregon|virginia|ireland|singapore|tokyo|sydney|saopaulo
If the test status is finished, exit code is 0, failed, exit code is 1, SLA failed, exit code is 3.
Currently, lbtest supports Selenium HTML Script and CasperJs Test Script. The following is a simple CasperJs Test Script sample:
var vuSn=casper.lbParams?casper.lbParams.vuSn:"1";
if (!casper.addMetricsData)
casper.addMetricsData=function(metrics,value) {console.log(metrics+":"+ value)};
//sumType: "sum"|"min"|"max"|"avg"
//default Value: {sumType:"sum", group:"", drawChart:true, color: undefined}
//usage: casper.addMetricsData(metrics,metricsValue, yourValue1, yourValue2 ...); //metricsValue must be a number, your value can be any type.
if (casper.lbParams){
casper.lbParams.userDefinedMetrics= {
"Access homePage Count":{color:"blue"},
}
}
var accountEmail="test"+vuSn+"@loadbooster.com";
//casper.options.stepTimeout = 3 * 60 * 1000; //default stepTimeout is 3 minutes.
var x = require('casper').selectXPath;
casper.test.begin('step1: open todosdemo', function(test) {
casper.start('https://loadbooster.com/todosdemo');
casper.addMetricsData("Access homePage Count",1, "your data 1", "your data 2");
casper.run(function() {test.done();});
});
lbtest run-test-config -p 1-100:1 'YOUR-TEST-CONFIG-ID'
lbtest run-scenario -p 1-100:1 'YOUR-SCENARIO-ID'
Use 'lbtest validate' command to validate a test script file or an existing user scenario.
Usage: validate [options]
i.e. lbtest validate -s ~/casperjs-sample.js
lbtest validate -e ~/selenium-sample.html
lbtest validate -u 'YOUR-SCENARIO-ID'
Options:
-h, --help output usage information
-s, --script <string> CasperJs Test Script to validate
-e, --selenium-script <string> Selenium test case (HTML file)
-u, --user-scenario <string> Scenario Id to validate
-v, --verbose Enable Verbose Mode
A sample validate output result:
[INFO] initialing
[INFO] +5s running
[ERROR] +25s failed
*****The following is the validation result*****
Test file: /home/ubuntu/loadbooster/lib/run_casper.js
****************** first time *******************
# step1: open home page
Access homePage Count:1
# step2: random error
Access homePage Count:1
[ERROR] [phantom] casper.page.onResourceError:{"errorCode":404,"errorString":"Not Found","id":23,
"url":"http://loadbooster.com:18000/code/404"}
currentStep:{"type":"MainScript","stepNo":2,"name":"step2: random error"}
(The MIT License)
Copyright (c) 2014 qinghai qinghai@loadbooster.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
LoadBooster.com CLI to load test web applications from the command line
The npm package lbtest receives a total of 0 weekly downloads. As such, lbtest popularity was classified as not popular.
We found that lbtest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.