File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1229,6 +1229,25 @@ def test_timeout_file_read(self):
12291229 finally :
12301230 os .unlink (_file )
12311231
1232+ def test_file_read_no_timeout (self ):
1233+ try :
1234+ xrange
1235+ except NameError :
1236+ xrange = range
1237+ dir_name = os .path .dirname (__file__ )
1238+ _file = os .sep .join ((dir_name , 'file_to_read' ))
1239+ contents = [b'a line\n ' for _ in xrange (10000 )]
1240+ with open (_file , 'wb' ) as fh :
1241+ fh .writelines (contents )
1242+ output = self .client .run_command ('cat %s' % (_file ,), timeout = 10 )
1243+ try :
1244+ _out = list (output [self .client .hosts [0 ]].stdout )
1245+ finally :
1246+ os .unlink (_file )
1247+ _contents = [c .decode ('utf-8' ).strip () for c in contents ]
1248+ self .assertEqual (len (contents ), len (_out ))
1249+ self .assertListEqual (_contents , _out )
1250+
12321251 ## OpenSSHServer needs to run in its own thread for this test to work
12331252 ## Race conditions otherwise.
12341253 #
You can’t perform that action at this time.
0 commit comments