testing/mozbase/mozdevice/sut_tests/test_exec.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/mozbase/mozdevice/sut_tests/test_exec.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,23 @@
     1.4 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 +
     1.8 +import posixpath
     1.9 +from StringIO import StringIO
    1.10 +
    1.11 +from dmunit import DeviceManagerTestCase
    1.12 +
    1.13 +class ExecTestCase(DeviceManagerTestCase):
    1.14 +
    1.15 +    def runTest(self):
    1.16 +        """Simple exec test, does not use env vars."""
    1.17 +        out = StringIO()
    1.18 +        filename = posixpath.join(self.dm.getDeviceRoot(), 'test_exec_file')
    1.19 +        # Make sure the file was not already there
    1.20 +        self.dm.removeFile(filename)
    1.21 +        self.dm.shell(['dd', 'if=/dev/zero', 'of=%s' % filename, 'bs=1024',
    1.22 +                       'count=1'], out)
    1.23 +        # Check that the file has been created
    1.24 +        self.assertTrue(self.dm.fileExists(filename))
    1.25 +        # Clean up
    1.26 +        self.dm.removeFile(filename)

mercurial