From 1ed808027be23e5d4a75847c47d57581dfe91b09 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Tue, 22 Aug 2017 19:30:39 +0200 Subject: [PATCH] RemoteProcess: add an unit test for the cwd parameter. Signed-off-by: Radoslaw Zarzynski --- teuthology/orchestra/test/test_run.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/teuthology/orchestra/test/test_run.py b/teuthology/orchestra/test/test_run.py index 8b9b7c0c5..c14a148e0 100644 --- a/teuthology/orchestra/test/test_run.py +++ b/teuthology/orchestra/test/test_run.py @@ -86,6 +86,15 @@ class TestRun(object): ) assert proc.exitstatus == 0 + def test_run_cwd(self): + self.m_stdout_buf.channel.recv_exit_status.return_value = 0 + run.run( + client=self.m_ssh, + args=['foo_bar_baz'], + cwd='/cwd/test', + ) + self.m_ssh.exec_command.assert_called_with('(cd /cwd/test && exec foo_bar_baz)') + def test_capture_stdout(self): output = 'foo\nbar' set_buffer_contents(self.m_stdout_buf, output) -- 2.47.3