diff --git a/test/s3p/generator/locustfile.py b/test/s3p/generator/locustfile.py
new file mode 100644
index 0000000..63031cd
--- /dev/null
+++ b/test/s3p/generator/locustfile.py
@@ -0,0 +1,186 @@
+import random
+import string
+import time
+import datetime
+import sys
+import collections
+import json
+import tzlocal
+import os
+import fcntl
+import logging
+from locust import HttpLocust, TaskSet, task
+from decimal import Decimal
+
+
+class UserBehavior(TaskSet):
+    base = "/ecomp/mso/infra/e2eServiceInstances/v3"
+    headers = {"Accept":"application/json","Content-Type":"application/json","Authorization":"Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA=="}
+    service_creation_body = "{\"service\": {\"name\": \"E2E_volte_%s\", \"description\": \"E2E_volte_ONAP_deploy\", \"serviceDefId\": \"a16eb184-4a81-4c8c-89df-c287d390315a\", \"templateId\": \"012c3446-51db-4a2a-9e64-a936f10a5e3c\", \"parameters\": { \"globalSubscriberId\": \"Demonstration\", \"subscriberName\": \"Demonstration\", \"serviceType\": \"vIMS\", \"templateName\": \"VoLTE e2e Service:null\", \"resources\": [ { \"resourceName\": \"VL OVERLAYTUNNEL\", \"resourceDefId\": \"671d4757-b018-47ab-9df3-351c3bda0a98\", \"resourceId\": \"e859b0fd-d928-4cc8-969e-0fee7795d623\", \"nsParameters\": { \"locationConstraints\": [], \"additionalParamForNs\": { \"site2_vni\": \"5010\", \"site1_localNetworkAll\": \"false\", \"site1_vni\": \"5010\", \"site1_exportRT1\": \"11:1\", \"description\": \"overlay\", \"site2_localNetworkAll\": \"false\", \"site1_routerId\": \"9.9.9.9\", \"site1_fireWallEnable\": \"false\", \"site1_networkName\": \"network1\", \"site2_description\": \"overlay\", \"site1_importRT1\": \"11:1\", \"site1_description\": \"overlay\", \"site2_networkName\": \"network3\", \"name\": \"overlay\", \"site2_fireWallEnable\": \"false\", \"site2_id\": \"ZTE-DCI-Controller\", \"site2_routerId\": \"9.9.9.9\", \"site2_importRT1\": \"11:1\", \"site2_exportRT1\": \"11:1\", \"site2_fireWallId\": \"false\", \"site1_id\": \"DCI-Controller-1\", \"tunnelType\": \"L3-DCI\" } } },{\"resourceName\": \"VL UNDERLAYVPN\", \"resourceDefId\": \"4f5d692b-4022-43ab-b878-a93deb5b2061\", \"resourceId\": \"b977ec47-45b2-41f6-aa03-bf6554dc9620\", \"nsParameters\": { \"locationConstraints\": [], \"additionalParamForNs\": { \"topology\": \"full-mesh\", \"site2_name\": \"site2\", \"sna2_name\": \"site2_sna\", \"description\": \"underlay\", \"sna1_name\": \"site1_sna\", \"ac1_route\": \"3.3.3.12/30:dc84ce88-99f7\", \"ac2_peer_ip\": \"3.3.3.20/30\", \"technology\": \"mpls\", \"ac2_route\": \"3.3.3.20/30:98928302-3287\", \"ac2_id\": \"84d937a4-b227-375f-a744-2b778f36e04e\", \"ac1_protocol\": \"STATIC\", \"ac2_svlan\": \"4004\", \"serviceType\": \"l3vpn-ipwan\", \"ac2_ip\": \"3.3.3.21/30\", \"pe2_id\": \"4412d3f0-c296-314d-9284-b72fc5d485e8\", \"ac1_id\": \"b4f01ac0-c1e1-3e58-a8be-325e4372c960\", \"af_type\": \"ipv4\", \"ac1_svlan\": \"4002\", \"ac1_peer_ip\": \"3.3.3.12/30\", \"ac1_ip\": \"3.3.3.13/30\", \"version\": \"1.0\", \"name\": \"testunderlay\", \"id\": \"123124141\", \"pe1_id\": \"2ef788f0-407c-3070-b756-3a5cd71fde18\", \"ac2_protocol\": \"STATIC\", \"site1_name\": \"stie1\" } } } ] } } }"
+    # following class variables to make them unique across all users
+    transaction_file= open("transaction.log", "w+")
+    operation_file = open("operation.log", "w+")
+    
+    def on_start(self):
+        """ on_start is called when a Locust start before any task is scheduled """
+        self.init()
+
+    def init(self):
+	pass
+
+    def myconverter(self, o):
+        if isinstance(o, datetime.datetime):
+            return o.__str__()
+
+    @task(1)
+    def create_service(self):
+	# Post a E2E service instantiation request to SO
+        method = "POST"
+	url = self.base
+	service_instance_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
+	data = self.service_creation_body % service_instance_name
+
+	t1 = datetime.datetime.now(tzlocal.get_localzone())
+        response = self.client.request(method, url, headers=self.headers, data=data)
+	t2 = datetime.datetime.now(tzlocal.get_localzone())
+	delta = t2 - t1
+        data = collections.OrderedDict()
+        data['datetime'] = datetime.datetime.now(tzlocal.get_localzone()).strftime("%Y-%m-%dT%H:%M:%S%Z")
+        data['method'] = method
+        data['url'] = url
+        data['status_code'] = response.status_code
+        data['transaction_time'] = (delta.seconds*10^6 + delta.microseconds)/1000
+        fcntl.flock(self.transaction_file, fcntl.LOCK_EX)
+        self.transaction_file.write(json.dumps(data, default = self.myconverter) + "\n") 
+        self.transaction_file.flush()
+        os.fsync(self.transaction_file)
+        fcntl.flock(self.transaction_file, fcntl.LOCK_UN)
+	serviceId = response.json()['service']['serviceId']
+	operationId = response.json()['service']['operationId']
+
+	# Get the request status
+	method = "GET"
+	url = self.base + "/" + serviceId + "/operations/" + operationId
+	url1 = "/ecomp/mso/infra/e2eServiceInstances/v3/{serviceId}/operations/{operationId}"
+	count = 1
+	while count < 50:
+	    tt1 = datetime.datetime.now()
+	    response = self.client.request(method, url, name=url1, headers=self.headers)
+	    tt2 = datetime.datetime.now()
+            delta = tt2 - tt1
+	    result = response.json()['operationStatus']['result']	    
+	    progress = response.json()['operationStatus']['progress']
+            data = collections.OrderedDict()
+            data['datetime'] = datetime.datetime.now(tzlocal.get_localzone()).strftime("%Y-%m-%dT%H:%M:%S%Z")
+            data['method'] = method
+            data['url'] = url1
+            data['status_code'] = response.status_code
+            data['count'] = count
+            data['result'] = result
+            data['progress'] = progress
+            data['transaction_time'] = (delta.seconds*10^6 + delta.microseconds)/1000
+            fcntl.flock(self.transaction_file, fcntl.LOCK_EX)
+            self.transaction_file.write(json.dumps(data, default = self.myconverter) + "\n") 
+            self.transaction_file.flush()
+            os.fsync(self.transaction_file)
+            fcntl.flock(self.transaction_file, fcntl.LOCK_UN)
+	    if result == "finished" or result == "error":
+                break
+	    else:
+		time.sleep(1)
+		count = count + 1
+	
+        if result == "finished":
+            result = "success"
+        else:
+            result = "failure"
+	t3 = datetime.datetime.now(tzlocal.get_localzone())
+	delta = t3 - t1
+        data = collections.OrderedDict()
+        data['datetime'] = t1.strftime("%Y-%m-%dT%H:%M:%S%Z")
+        data['operation'] = "volte_create"
+        data['result'] = result
+        data['duration'] = round(delta.seconds + Decimal(delta.microseconds/1000000.0), 3)
+        fcntl.flock(self.operation_file, fcntl.LOCK_EX)
+        self.operation_file.write(json.dumps(data, default = self.myconverter) + "\n")
+        self.operation_file.flush()
+        os.fsync(self.operation_file)
+        fcntl.flock(self.operation_file, fcntl.LOCK_UN)
+
+	self.delete_service(serviceId)
+
+    def delete_service(self, serviceId):
+	method = "DELETE"
+ 	url = self.base + "/" + serviceId
+	data = "{\"globalSubscriberId\":\"Demonstration\", \"serviceType\":\"vIMS\"}" 	
+	t1 = datetime.datetime.now(tzlocal.get_localzone())
+        response = self.client.request(method, url, name=self.base, headers=self.headers, data=data)
+	t2 = datetime.datetime.now(tzlocal.get_localzone())
+	delta = t2 - t1
+        data = collections.OrderedDict()
+        data['datetime'] = datetime.datetime.now(tzlocal.get_localzone()).strftime("%Y-%m-%dT%H:%M:%S%Z")
+        data['method'] = method
+        data['url'] = self.base
+        data['status_code'] = response.status_code
+        data['transaction_time'] = (delta.seconds*10^6 + delta.microseconds)/1000
+        fcntl.flock(self.transaction_file, fcntl.LOCK_EX)
+        self.transaction_file.write(json.dumps(data, default = self.myconverter) + "\n")
+        self.transaction_file.flush()
+        os.fsync(self.transaction_file)
+        fcntl.flock(self.transaction_file, fcntl.LOCK_UN)
+	operationId = response.json()['operationId']
+
+	# Get the request status
+	method = "GET"
+	url = self.base + "/" + serviceId + "/operations/" + operationId
+	url1 = "/ecomp/mso/infra/e2eServiceInstances/v3/{serviceId}/operations/{operationId}"
+	count = 1
+	while count < 50:
+	    tt1 = datetime.datetime.now(tzlocal.get_localzone())
+	    response = self.client.request(method, url, name=url1, headers=self.headers)
+	    tt2 = datetime.datetime.now(tzlocal.get_localzone())
+            delta = tt2 - tt1
+	    result = response.json()['operationStatus']['result']	    
+	    progress = response.json()['operationStatus']['progress']
+            data = collections.OrderedDict()
+            data['datetime'] = datetime.datetime.now(tzlocal.get_localzone()).strftime("%Y-%m-%dT%H:%M:%S%Z")
+            data['method'] = method
+            data['url'] = url1
+            data['status_code'] = response.status_code
+            data['count'] = count
+            data['result'] = result
+            data['progress'] = progress
+            data['transaction_time'] = (delta.seconds*10^6 + delta.microseconds)/1000
+            fcntl.flock(self.transaction_file, fcntl.LOCK_EX)
+            self.transaction_file.write(json.dumps(data, default = self.myconverter) + "\n") 
+            self.transaction_file.flush()
+            os.fsync(self.transaction_file)
+            fcntl.flock(self.transaction_file, fcntl.LOCK_UN)
+	    if result == "finished" or result == "error":
+		break
+	    else:
+		time.sleep(1)
+		count = count + 1
+	
+        if result == "finished":
+            result = "success"
+        else:
+            result = "failure"
+	t3 = datetime.datetime.now(tzlocal.get_localzone())
+	delta = t3 - t1
+        data = collections.OrderedDict()
+        data['datetime'] = t1.strftime("%Y-%m-%dT%H:%M:%S%Z")
+        data['operation'] = "volte_delete"
+        data['result'] = result
+        data['duration'] = round(delta.seconds + Decimal(delta.microseconds/1000000.0), 3)
+        fcntl.flock(self.operation_file, fcntl.LOCK_EX)
+        self.operation_file.write(json.dumps(data, default = self.myconverter) + "\n")
+        self.operation_file.flush()
+        os.fsync(self.operation_file)
+        fcntl.flock(self.operation_file, fcntl.LOCK_UN)
+
+        
+class WebsiteUser(HttpLocust):
+    task_set = UserBehavior
+    min_wait = 1000
+    max_wait = 3000
