diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-06-05 19:42:02 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-06-05 19:42:02 +0100 |
commit | eb4f41cea26612d9161fa1094ad0a0b7c411e64d (patch) | |
tree | cb27d3a397cafa3ea51dba08d5369419481788e1 | |
parent | 2ad9f2c32c4ade313dbefb96235939ad393f5420 (diff) | |
download | systest-eb4f41cea26612d9161fa1094ad0a0b7c411e64d.tar.gz |
Add way for hostcmd and targetcmd to provide stdin contents.
-rwxr-xr-x | systest | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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) |