Skip to content

Commit

Permalink
Fixed #38: Allow websocket url/domain to be set in the load testing t…
Browse files Browse the repository at this point in the history
…ool. Fixed #36: Develop script that will drive Selenium for the load testing. Fixed #37: Ehnance and organize all testing tools & resources in one place
  • Loading branch information
Antonis Tsakiridis committed Mar 5, 2016
1 parent 0817b0a commit 6435dba
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 226 deletions.
27 changes: 0 additions & 27 deletions test/load-testing/application-server.js

This file was deleted.

11 changes: 8 additions & 3 deletions test/load-testing/restcomm-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,16 @@ def globalTeardown(dictionary):
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--client-count', dest = 'count', default = 10, type = int, help = 'Count of Webrtc clients spawned for the test')
parser.add_argument('-u', '--client-url', dest = 'url', default = 'http://127.0.0.1:10510/webrtc-client.html', help = 'Webrtc clients target URL, like \'http://127.0.0.1:10510/webrtc-client.html\'')
parser.add_argument('-w', '--client-register-ws-url', dest = 'registerWsUrl', default = 'ws://127.0.0.1:5082', help = 'Webrtc clients target websocket URL for registering, like \'ws://127.0.0.1:5082\'')
parser.add_argument('-d', '--client-register-domain', dest = 'registerDomain', default = '127.0.0.1', help = 'Webrtc clients domain for registering, like \'127.0.0.1\'')
#parser.add_argument('-e', '--external-service', dest = 'externalService', default = 'http://127.0.0.1:10512/rcml', help = 'External service for Restcomm to get RCML, like \'http://127.0.0.1:10512/rcml\'')
parser.add_argument('-x', '--client-user-prefix', dest = 'userPrefix', default = 'user', help = 'User prefix for the clients, like \'user\'')
parser.add_argument('-p', '--client-password', dest = 'password', default = '1234', help = 'Password for the clients, like \'1234\'')
parser.add_argument('-s', '--account-sid', dest = 'accountSid', required = True, help = 'Restcomm accound Sid, like \'ACae6e420f425248d6a26948c17a9e2acf\'')
parser.add_argument('-a', '--auth-token', dest = 'authToken', required = True, help = 'Restcomm auth token, like \'0a01c34aac72a432579fe08fc2461036\'')
parser.add_argument('-r', '--http-protocol', dest = 'httpProtocol', default = 'http', help = 'Restcomm http protocol: \'http\' (default) or \'https\'')
parser.add_argument('-t', '--transport', dest = 'transport', default = '127.0.0.1:8080', help = 'Restcomm transport, like \'127.0.0.1:8080\'')

args = parser.parse_args()

print TAG + 'Using Webrtc Client count: ' + str(args.count) + ', targeting URL: ' + args.url + ', using password: ' + args.password
Expand All @@ -168,7 +171,10 @@ def globalTeardown(dictionary):
# Populate a list with ids and URLs for each client thread that will be spawned
urls = list()
for i in range(1, args.count + 1):
urls.append({'id': i, 'url' : args.url + '?username=' + args.userPrefix + str(i) + '&password=' + args.password})
urls.append({
'id': i,
'url' : args.url + '?username=' + args.userPrefix + str(i) + '&password=' + args.password + '&register-ws-url=' + args.registerWsUrl + '&register-domain=' + args.registerDomain,
})

globalSetup({
'count': args.count,
Expand All @@ -182,8 +188,7 @@ def globalTeardown(dictionary):

# Make the Pool of workers
pool = ThreadPool(args.count)
# Open the urls in their own threads
# and return the results
# Open the urls in their own threads and return the results
results = pool.map(threadFunction, urls)
# close the pool and wait for the work to finish
pool.close()
Expand Down
2 changes: 1 addition & 1 deletion test/load-testing/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (process.argv[5]) {
HTTPS_PORT = process.argv[5];
}

console.log('[server.js] Initializing http(s) server with ' + CLIENT_COUNT + ' clients, listening for RCML (REST) at: ' + RCML_PORT + ', listening for http (Webrtc App) at: ' + HTTP_PORT + ', listening for https (Webrtc App) at: ' + HTTPS_PORT);
console.log('[server.js] Initializing http(s) server with ' + CLIENT_COUNT + ' clients: \n\tRCML (REST) port: ' + RCML_PORT + ' \n\thttp (Webrtc App) port: ' + HTTP_PORT + ' \n\thttps (Webrtc App) port: ' + HTTPS_PORT);

// Serve html pages over http
var fileServer = new(nodeStatic.Server)();
Expand Down
110 changes: 0 additions & 110 deletions test/load-testing/test-driver.py

This file was deleted.

83 changes: 0 additions & 83 deletions test/load-testing/toolbox.pl

This file was deleted.

12 changes: 10 additions & 2 deletions test/load-testing/webrtc-client.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,22 @@
if (!password) {
password = '1234'
}
var registerWsUrl = getParameterByName('register-ws-url');
if (!registerWsUrl) {
registerWsUrl = 'ws://127.0.0.1:5082'
}
var registerDomain = getParameterByName('register-domain');
if (!registerDomain) {
registerDomain = '127.0.0.1'
}

var currentConnection;
var parameters = {
'debug': true,
'username': username,
'password': password,
'registrar': 'ws://127.0.0.1:5082',
'domain': '127.0.0.1',
'registrar': registerWsUrl,
'domain': registerDomain,
};

RestCommClient.Device.setup(parameters);
Expand Down

0 comments on commit 6435dba

Please sign in to comment.