aboutsummaryrefslogtreecommitdiffstats
path: root/pods
diff options
context:
space:
mode:
authorSridhar Rao <sridhar.rao@spirent.com>2021-06-17 12:00:09 +0000
committerGerrit Code Review <gerrit@opnfv.org>2021-06-17 12:00:09 +0000
commit7e7df7806ac7fdd23f29f26217eb3385134cbf1e (patch)
tree3e93cc76d9af6c1e0f09ee42100b9aedf016183c /pods
parentb3d8f3e6b150a9c1a031e4f27f3d192119e26d85 (diff)
parent8137692dd94e112943dcc576470f4b361fbd8c5c (diff)
Merge "WIP:Infrastructure for supporting more K8S Tests."
Diffstat (limited to 'pods')
-rw-r--r--pods/papi/papi.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/pods/papi/papi.py b/pods/papi/papi.py
index 5a21f1d6..5a96660d 100644
--- a/pods/papi/papi.py
+++ b/pods/papi/papi.py
@@ -49,9 +49,12 @@ class Papi(IPod):
"""
Creation Process
"""
+ print("Entering Create Function")
# create vswitchperf namespace
api = client.CoreV1Api()
namespace = 'default'
+ pod_manifests = S.getValue('POD_MANIFEST_FILEPATH')
+ pod_count = int(S.getValue('POD_COUNT'))
#namespace = 'vswitchperf'
# replace_namespace(api, namespace)
@@ -68,6 +71,8 @@ class Papi(IPod):
version = 'v1'
kind_plural = 'network-attachment-definitions'
api = client.CustomObjectsApi()
+
+ assert pod_count <= len(pod_manifests)
for nad_filepath in S.getValue('NETWORK_ATTACHMENT_FILEPATH'):
nad_manifest = load_manifest(nad_filepath)
@@ -81,15 +86,17 @@ class Papi(IPod):
raise Exception from err
#create pod workloads
- pod_manifest = load_manifest(S.getValue('POD_MANIFEST_FILEPATH'))
api = client.CoreV1Api()
+
+ for count in range(pod_count):
+ pod_manifest = load_manifest(pod_manifests[count])
- try:
- response = api.create_namespaced_pod(namespace, pod_manifest)
- self._logger.info(str(response))
- self._logger.info("Created POD %d ...", self._number)
- except ApiException as err:
- raise Exception from err
+ try:
+ response = api.create_namespaced_pod(namespace, pod_manifest)
+ self._logger.info(str(response))
+ self._logger.info("Created POD %d ...", self._number)
+ except ApiException as err:
+ raise Exception from err
time.sleep(12)