#NEWLINE# def test_extendedAttributes( self ) : #NEWLINE# #INDENT# '\n        Test the return of extended attributes by the server: the sftp client\n        should ignore them, but still be able to parse the response correctly.\n\n        This test is mainly here to check that\n        L{filetransfer.FILEXFER_ATTR_EXTENDED} has the correct value.\n        ' #NEWLINE# fn = self . mktemp ( ) #NEWLINE# with open ( fn , 'w' ) as f : #NEWLINE# #INDENT# f . write ( 'ls .\nexit' ) #NEWLINE# #UNINDENT# port = self . server . getHost ( ) . port #NEWLINE# oldGetAttr = FileTransferForTestAvatar . _getAttrs #NEWLINE# def _getAttrs( self , s ) : #NEWLINE# #INDENT# attrs = oldGetAttr ( self , s ) #NEWLINE# attrs [ 'ext_foo' ] = 'bar' #NEWLINE# return attrs #NEWLINE# #UNINDENT# self . patch ( FileTransferForTestAvatar , '_getAttrs' , _getAttrs ) #NEWLINE# self . server . factory . expectedLoseConnection = True #NEWLINE# d = getProcessValue ( 'ssh' , ( '-o' , 'PubkeyAcceptedKeyTypes=ssh-dss' , '-V' ) ) #NEWLINE# def hasPAKT( status ) : #NEWLINE# #INDENT# if ( status == 0 ) : #NEWLINE# #INDENT# args = ( '-o' , 'PubkeyAcceptedKeyTypes=ssh-dss' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# args = ( ) #NEWLINE# #UNINDENT# args += ( '-F' , '/dev/null' , '-o' , 'IdentityFile=dsa_test' , '-o' , 'UserKnownHostsFile=kh_test' , '-o' , 'HostKeyAlgorithms=ssh-rsa' , '-o' , ( 'Port=%i' % ( port , ) ) , '-b' , fn , 'testuser@127.0.0.1' ) #NEWLINE# return args #NEWLINE# #UNINDENT# def check( result ) : #NEWLINE# #INDENT# self . assertEqual ( result [ 2 ] , 0 ) #NEWLINE# for i in [ 'testDirectory' , 'testRemoveFile' , 'testRenameFile' , 'testfile1' ] : #NEWLINE# #INDENT# self . assertIn ( i , result [ 0 ] ) #NEWLINE# #UNINDENT# #UNINDENT# d . addCallback ( hasPAKT ) #NEWLINE# d . addCallback ( ( lambda args : getProcessOutputAndValue ( 'sftp' , args ) ) ) #NEWLINE# return d . addCallback ( check )