Commit f1610f0e authored by Yusei Tahara's avatar Yusei Tahara Committed by Klaus Wölfel

erp5/util/testnode, scalability_test: Stop using a dummy frontend master and...

erp5/util/testnode, scalability_test: Stop using a dummy frontend master and use host.vifib.net frontend with a valid SSL certificate instead. Always use https.

Conflicts:
	scalability_test/__init__.py
parent 741a77e9
This diff is collapsed.
......@@ -468,10 +468,8 @@ class SlapOSTester(SlapOSMasterCommunicator):
information = self.getInformationFromInstance(instance["href"])
if "frontend-" in instance["title"]:
try:
# TODO: this should get "secure_access" value (https). Until having a
# valid certificate, the "site_url" (http) will be used.
frontend = [instance["title"].replace("frontend-", ""),
information["connection_dict"]["site_url"]]
information["connection_dict"]["secure_access"]]
frontend_url_list.append(frontend)
except Exception as e:
logger.info("Frontend url not generated yet for instance: " + instance["title"])
......
import os.path
import json
ZOPE_USER_FAMILY = "user"
ZOPE_ACTIVITIES_FAMILIY = "activities"
PERSON_KEY = "person_per_hour"
ORDER_KEY = "sale_order_per_hour"
class ERP5_scalability():
def getTestList(self):
return ['createPerson', 'createSaleOrder']
def getTestPath(self):
return 'example/'
def getUsersFilePath(self):
return 'example/scalabilityUsers'
def getUserQuantity(self, test_number):
return [8, 14, 20, 28, 36][test_number]
def getTestDuration(self, test_number):
return 60*10
def getTestRepetition(self, test_number):
return 3
def getScalabilityTestUrl(self, instance_information_dict):
for frontend in instance_information_dict['frontend-url-list']:
if frontend[0] == ZOPE_USER_FAMILY:
frontend_address = frontend[1]
break
return "%s/erp5" % (frontend_address)
def getScalabilityTestMetricUrl(self, instance_information_dict, **kw):
frontend_address = self.getScalabilityTestUrl(instance_information_dict)
metrics_url = frontend_address.replace("://",
"://%s:%s@" % (instance_information_dict['user'],
instance_information_dict['password']))
return metrics_url + "/ERP5Site_getScalabilityTestMetric"
def getBootstrapScalabilityTestUrl(self, instance_information_dict, count=0, **kw):
frontend_address = self.getScalabilityTestUrl(instance_information_dict)
bootstrap_url = frontend_address.replace("://",
"://%s:%s@" % (instance_information_dict['user'],
instance_information_dict['password']))
bootstrap_url += "/ERP5Site_bootstrapScalabilityTest"
bootstrap_url += "?user_quantity=%i" % self.getUserQuantity(count)
return bootstrap_url
def getSiteAvailabilityUrl(self, instance_information_dict, **kw):
frontend_address = self.getScalabilityTestUrl(instance_information_dict)
site_url = frontend_address.replace("://",
"://%s:%s@" % (instance_information_dict['user'],
instance_information_dict['password']))
return site_url + "/ERP5Site_isReady"
def getScalabilityTestOutput(self, metric_list):
"""
From the list of metrics taken during a test run, select the best metric
for the test output by a specific criteria
"""
if not metric_list: return None
output_json = json.loads(metric_list[0])
for metric in metric_list:
metric_json = json.loads(metric)
if metric_json[PERSON_KEY] > output_json[PERSON_KEY]:
output_json[PERSON_KEY] = metric_json[PERSON_KEY]
if metric_json[ORDER_KEY] > output_json[ORDER_KEY]:
output_json[ORDER_KEY] = metric_json[ORDER_KEY]
return "Person: %s doc/hour; SaleOrder: %s doc/hour;" % (
str(output_json[PERSON_KEY]), str(output_json[ORDER_KEY]))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment