From 5be0a76d76aefbfc7b0555482df2dada7a6e5a08 Mon Sep 17 00:00:00 2001 From: opensource-tnbt Date: Wed, 25 Nov 2020 15:11:47 +0530 Subject: Kubernetes: Infrastructure For K8S Net testing. This patch adds necessary code to perform K8S Networking performance benchmarking. Signed-off-by: Sridhar K. N. Rao Change-Id: I059ddd2e9ad3ee7c05e4620c64401f81474be195 --- core/loader/loader.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'core/loader') 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. -- cgit 1.2.3-korg