This repository was archived by the owner on Sep 2, 2024. It is now read-only.

Description
The server exposes count, product, and random endpoints, but the client only exercises count by default. In addition it is difficult to exercise the wide variety of possible endpoints since they accept arbitrary numbers.
Suggestion: Something like this:
config-ssr.json
@@ -14,7 +15,9 @@
"root_endpoint": "/",
"no_db": true,
"get_endpoints": [
- "count/10000/15"
+ "count/{{RANDOM}}00/{{RANDOM}}",
+ "product/{{RANDOM}}",
+ "random/{{RANDOM}}"
],
runspec.py
@@ -607,9 +658,17 @@ def get_data():
def generate_urls_from_list():
urls_count = len(get_endpoints_urls)
for ii in xrange(int(total_urls)):
+ # Which URL to use?
urls_idx = random.randint(0, urls_count - 1)
+
+ # Resolve templating
+ templateURL = get_endpoints_urls[urls_idx]
+ while '{{RANDOM}}' in templateURL:
+ templateURL = templateURL.replace('{{RANDOM}}', str(random.randint(0, 100)), 1)
+ fullURL = templateURL
+
urllist.append({
- 'url': get_endpoints_urls[urls_idx],
+ 'url': fullURL,
'method':'GET'})