diff options
author | Yiting.Li <liyiting@huawei.com> | 2015-12-22 17:11:12 -0800 |
---|---|---|
committer | Yiting.Li <liyiting@huawei.com> | 2015-12-22 17:11:12 -0800 |
commit | 8f1101df131a4d3e03b377738507d88b745831c0 (patch) | |
tree | 73f140474fcec2a77c85a453f6946957ca0742d1 /vstf/vstf/controller/fabricant.py | |
parent | 1a24ebbda3f95600c0e7d5ed8661317a8ff7e265 (diff) |
Upload the contribution of vstf as bottleneck network framework.
End to End Performance test
JIRA:BOTTLENECK-29
Change-Id: Ib2c553c8b60d6cda9e7a7b52b737c9139f706ebd
Signed-off-by: Yiting.Li <liyiting@huawei.com>
Diffstat (limited to 'vstf/vstf/controller/fabricant.py')
-rwxr-xr-x | vstf/vstf/controller/fabricant.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/vstf/vstf/controller/fabricant.py b/vstf/vstf/controller/fabricant.py new file mode 100755 index 00000000..c67bfa19 --- /dev/null +++ b/vstf/vstf/controller/fabricant.py @@ -0,0 +1,49 @@ +from vstf.rpc_frame_work import constant as const +import vstf.common.constants as cst + + +class Fabricant(object): + def __init__(self, target, conn): + self.conn = conn + self.target = target + + self.all_commands = self.declare_commands + self.instance_commands() + + @property + def declare_commands(self): + driver = {"install_drivers", "clean_drivers", "autoneg_on", "autoneg_off", "autoneg_query"} + + builder = {"build_env", "clean_env"} + + cpu = {"affctl_load", "affctl_list", "run_cpuwatch", "kill_cpuwatch"} + + perf = {"perf_run", "run_vnstat", "kill_vnstat", "force_clean"} + + device_mgr = {"get_device_detail", "list_nic_devices", "get_device_verbose"} + + netns = {"clean_all_namespace", "config_dev", "recover_dev", "ping"} + + collect = {"collect_host_info"} + + cmdline = {"execute"} + + spirent = {"send_packet", "stop_flow", "mac_learning", "run_rfc2544suite", "run_rfc2544_throughput", + "run_rfc2544_frameloss", "run_rfc2544_latency"} + + equalizer = {"get_numa_core", "get_nic_numa", "get_nic_interrupt_proc", "get_vm_info", "bind_cpu", + "catch_thread_info"} + + return driver | cpu | builder | perf | device_mgr | netns | cmdline | collect | spirent | equalizer + + def instance_commands(self): + for command in self.all_commands: + setattr(self, command, self.__transfer_msg(command)) + + def __transfer_msg(self, command): + def infunc(timeout=cst.TIMEOUT, **kwargs): + msg = self.conn.make_msg(command, **kwargs) + return self.conn.call(msg, self.target, timeout) + + infunc.__name__ = command + return infunc |