michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: import posixpath michael@0: from StringIO import StringIO michael@0: michael@0: from dmunit import DeviceManagerTestCase michael@0: michael@0: class ExecTestCase(DeviceManagerTestCase): michael@0: michael@0: def runTest(self): michael@0: """Simple exec test, does not use env vars.""" michael@0: out = StringIO() michael@0: filename = posixpath.join(self.dm.getDeviceRoot(), 'test_exec_file') michael@0: # Make sure the file was not already there michael@0: self.dm.removeFile(filename) michael@0: self.dm.shell(['dd', 'if=/dev/zero', 'of=%s' % filename, 'bs=1024', michael@0: 'count=1'], out) michael@0: # Check that the file has been created michael@0: self.assertTrue(self.dm.fileExists(filename)) michael@0: # Clean up michael@0: self.dm.removeFile(filename)