From eb4f41cea26612d9161fa1094ad0a0b7c411e64d Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 5 Jun 2011 19:42:02 +0100 Subject: Add way for hostcmd and targetcmd to provide stdin contents. --- systest | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'systest') diff --git a/systest b/systest index 2b2af1b..bab5e34 100755 --- a/systest +++ b/systest @@ -52,7 +52,9 @@ class SystemTest(cliapp.Application): return methodname.replace('_', '-') def hostcmd(self, argv, stdin=None): - p = subprocess.Popen(argv, stdout=subprocess.PIPE, + p = subprocess.Popen(argv, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate(stdin) if p.returncode: @@ -106,6 +108,10 @@ class SystemTest(cliapp.Application): def test_ping_localhost_using_ipv6(self): self.targetcmd(['ping6', '-c1', 'ip6-localhost']) + + def test_cat_works(self): + out = self.targetcmd(['cat'], stdin='foo') + self.assertEqual(out, 'foo') # def test_sudo_works(self): # out = self.targetcmd(['sudo', 'id'], stdin=self.password) -- cgit v1.2.1