diff options
author | 2020-11-25 15:11:47 +0530 | |
---|---|---|
committer | 2020-11-25 15:23:55 +0530 | |
commit | 5be0a76d76aefbfc7b0555482df2dada7a6e5a08 (patch) | |
tree | 003daa1e3c97d6ff75522b672fecee2568d8efbd /core/loader/loader.py | |
parent | 092de71ff79b23ab05d013ceb417b4f0b48dcc55 (diff) |
Kubernetes: Infrastructure For K8S Net testing.
This patch adds necessary code to perform K8S Networking performance
benchmarking.
Signed-off-by: Sridhar K. N. Rao <sridhar.rao@spirent.com>
Change-Id: I059ddd2e9ad3ee7c05e4620c64401f81474be195
Diffstat (limited to 'core/loader/loader.py')
-rwxr-xr-x | core/loader/loader.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/core/loader/loader.py b/core/loader/loader.py index dcd77ced..45e0d5ba 100755 --- a/core/loader/loader.py +++ b/core/loader/loader.py @@ -23,6 +23,7 @@ from tools.pkt_fwd.pkt_fwd import IPktFwd from tools.pkt_gen.trafficgen import ITrafficGenerator from vswitches.vswitch import IVSwitch from vnfs.vnf.vnf import IVnf +from pods.pod.pod import IPod # pylint: disable=too-many-public-methods class Loader(object): @@ -71,6 +72,11 @@ class Loader(object): settings.getValue('PKTFWD'), IPktFwd) + self._pod_loader = LoaderServant( + settings.getValue('POD_DIR'), + settings.getValue('POD'), + IPod) + def get_trafficgen(self): """Returns a new instance configured traffic generator. @@ -220,6 +226,37 @@ class Loader(object): """ return self._vnf_loader.get_classes_printable() + def get_pod(self): + """Returns instance of currently configured pod implementation. + + :return: IPod implementation if available, None otherwise. + """ + return self._pod_loader.get_class()() + + def get_pod_class(self): + """Returns type of currently configured pod implementation. + + :return: Type of IPod implementation if available. + None otherwise. + """ + return self._pod_loader.get_class() + + def get_pods(self): + """Returns dictionary of all available pods. + + :return: Dictionary of pods. + - key: name of the class which implements IPod, + - value: Type of vnf which implements IPod. + """ + return self._pod_loader.get_classes() + + def get_pods_printable(self): + """Returns all available pods in printable format. + + :return: String containing printable list of pods. + """ + return self._pod_loader.get_classes_printable() + def get_pktfwd(self): """Returns instance of currently configured packet forwarder implementation. |