From 8953fa3d53019571a222a1aedb7cf796c5d67aec Mon Sep 17 00:00:00 2001 From: "wu.zhihui" Date: Fri, 22 Jul 2016 22:11:53 +0800 Subject: [Yardstick-233]latency measurment by using pktgen-dpdk VM A runs pktgen-dpdk as a traffic generator and is connected back-to-back with VM B running testpmd for forwarding packets. 1. use linux expect to fetch the latency statics data. 2. fetch 10 samples of latency and calculate avg_latency. 3. use screen to keep test scripts running in the background. 4. add a function send_command() for screen in ssh.py JIRA:YARDSTICK-233 Change-Id: I90ae64b3d198c79f159275ae35715eb284f05080 Signed-off-by: wu.zhihui --- tests/unit/test_ssh.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/unit/test_ssh.py') diff --git a/tests/unit/test_ssh.py b/tests/unit/test_ssh.py index 4260b39bc..574da0343 100644 --- a/tests/unit/test_ssh.py +++ b/tests/unit/test_ssh.py @@ -156,6 +156,15 @@ class SSHTestCase(unittest.TestCase): self.assertEqual([mock.call("uname")] * 3, self.test_client.execute.mock_calls) + @mock.patch("yardstick.ssh.paramiko") + def test_send_command(self, mock_paramiko): + paramiko_sshclient = self.test_client._get_client() + with mock.patch.object(paramiko_sshclient, "exec_command") \ + as mock_paramiko_exec_command: + self.test_client.send_command('cmd') + mock_paramiko_exec_command.assert_called_once_with('cmd', + get_pty=True) + class SSHRunTestCase(unittest.TestCase): """Test SSH.run method in different aspects. -- cgit 1.2.3-korg