OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 ''' |
| 3 PEXPECT LICENSE |
| 4 |
| 5 This license is approved by the OSI and FSF as GPL-compatible. |
| 6 http://opensource.org/licenses/isc-license.txt |
| 7 |
| 8 Copyright (c) 2012, Noah Spurrier <noah@noah.org> |
| 9 PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY |
| 10 PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE |
| 11 COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. |
| 12 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 13 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 14 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 15 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 19 |
| 20 ''' |
| 21 import pexpect |
| 22 import unittest |
| 23 from . import PexpectTestCase |
| 24 |
| 25 class ExpectTestCase(PexpectTestCase.PexpectTestCase): |
| 26 # This takes too long to run and isn't all that interesting of a test. |
| 27 def OFF_test_run_out_of_pty (self): |
| 28 '''This assumes that the tested platform has < 10000 pty devices. |
| 29 This test currently does not work under Solaris. |
| 30 Under Solaris it runs out of file descriptors first and |
| 31 ld.so starts to barf: |
| 32 ld.so.1: pt_chmod: fatal: /usr/lib/libc.so.1: Too many open files |
| 33 ''' |
| 34 plist=[] |
| 35 for count in range (0,10000): |
| 36 try: |
| 37 plist.append (pexpect.spawn('ls -l')) |
| 38 except pexpect.ExceptionPexpect: |
| 39 for c in range (0, count): |
| 40 plist[c].close() |
| 41 return |
| 42 except Exception: |
| 43 err = sys.exc_info()[1] |
| 44 self.fail ('Expected ExceptionPexpect. ' + str(err)) |
| 45 self.fail ('Could not run out of pty devices. This may be OK.') |
| 46 |
| 47 if __name__ == '__main__': |
| 48 unittest.main() |
| 49 |
| 50 suite = unittest.makeSuite(ExpectTestCase,'test') |
| 51 |
OLD | NEW |