test_run_out_of_pty.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:obsoleted-vpduserv 作者: InfraSIM 项目源码 文件源码
def OFF_test_run_out_of_pty (self):
        '''This assumes that the tested platform has < 10000 pty devices.
        This test currently does not work under Solaris.
        Under Solaris it runs out of file descriptors first and
        ld.so starts to barf:
            ld.so.1: pt_chmod: fatal: /usr/lib/libc.so.1: Too many open files
        '''
        plist=[]
        for count in range (0,10000):
                try:
                        plist.append (pexpect.spawn('ls -l'))
                except pexpect.ExceptionPexpect:
                        for c in range (0, count):
                            plist[c].close()
                        return
                except Exception:
                        err = sys.exc_info()[1]
                        self.fail ('Expected ExceptionPexpect. ' + str(err))
        self.fail ('Could not run out of pty devices. This may be OK.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号