diff options
author | Sridhar K. N. Rao <sridhar.rao@spirent.com> | 2021-06-02 19:11:18 +0530 |
---|---|---|
committer | Sridhar K. N. Rao <sridhar.rao@spirent.com> | 2021-06-15 21:34:48 +0530 |
commit | 8137692dd94e112943dcc576470f4b361fbd8c5c (patch) | |
tree | 7e1b60be919d8d1e8ce9821191a23aa8d8c1c758 /pods/papi | |
parent | 300d9f201aba1b8e30387138acaba79a72502d82 (diff) |
WIP:Infrastructure for supporting more K8S Tests.
This patch add multiple changes to ViNePerf to support following tests.
1. External virtual switch - not managed by Vineperf.
2. CNI not based on virtual switch
3. Fixed bugs after successful testing.
4. Pylint issues fixed
4. Fix some license-content and comments
Signed-off-by: Sridhar K. N. Rao <sridhar.rao@spirent.com>
Change-Id: Ie01735f99c0687cc812eae8e67ee2353347924f2
Diffstat (limited to 'pods/papi')
-rw-r--r-- | pods/papi/papi.py | 21 |
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) |