robot tcs, test charts, robot container added
[ta/cloudtaf.git] / resources / test_containers / http-traffic-gen / http_traffic_gen.py
diff --git a/resources/test_containers/http-traffic-gen/http_traffic_gen.py b/resources/test_containers/http-traffic-gen/http_traffic_gen.py
new file mode 100644 (file)
index 0000000..df19fa5
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+import thread
+import time
+import traceback
+import requests
+
+
+URL = "http://podinfo.kube-system.svc.rec.io:9898"
+LOCATION = "nokia"
+PARAMS = {'address': LOCATION}
+DELTA = 0.01
+
+
+def worker():
+    for _ in range(0, 1000):
+        time.sleep(DELTA)
+        requests.get(url=URL, params=PARAMS)
+
+try:
+    for x in range(0, 3):
+        thread.start_new_thread(worker, ("Thread-" + str(x), ))
+except Exception as e:
+    traceback.print_exc()
+
+time.sleep(40)