]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
RemoteProcess: add an unit test for the cwd parameter. 1093/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 22 Aug 2017 17:30:39 +0000 (19:30 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 22 Aug 2017 18:23:17 +0000 (20:23 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
teuthology/orchestra/test/test_run.py

index 8b9b7c0c52c3b9a58c7cdcdde67e6f9d948b5fd8..c14a148e0691a7410771c86bd3d5d1d0b74f0116 100644 (file)
@@ -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)