#NEWLINE# def test_scp_recursive_async( sshd_manager , loop ) : #NEWLINE# #INDENT# with sshd_manager . run ( 1 ) as sshd_ports : #NEWLINE# #INDENT# workspace = str ( sshd_manager . tmpdir ) #NEWLINE# id = uuid . uuid4 ( ) . hex #NEWLINE# pkgpanda . util . write_string ( ( workspace + '/recursive_pilot.txt' ) , id ) #NEWLINE# runner = MultiRunner ( [ '127.0.0.1:{}' . format ( port ) for port in sshd_ports ] , ssh_user = getpass . getuser ( ) , ssh_key_path = sshd_manager . key_path ) #NEWLINE# host_port = [ '127.0.0.1:{}' . format ( port ) for port in sshd_ports ] #NEWLINE# chain = CommandChain ( 'test' ) #NEWLINE# chain . add_copy ( ( workspace + '/recursive_pilot.txt' ) , ( workspace + '/recursive_pilot.txt.copied' ) , recursive = True ) #NEWLINE# try : #NEWLINE# #INDENT# copy_results = loop . run_until_complete ( runner . run_commands_chain_async ( [ chain ] , block = True , state_json_dir = workspace ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# loop . close ( ) #NEWLINE# #UNINDENT# dest_path = ( workspace + '/recursive_pilot.txt.copied' ) #NEWLINE# assert os . path . exists ( dest_path ) #NEWLINE# assert os . path . isfile ( dest_path ) #NEWLINE# assert ( len ( copy_results ) == 1 ) #NEWLINE# assert ( pkgpanda . util . load_string ( dest_path ) == id ) #NEWLINE# for host_result in copy_results : #NEWLINE# #INDENT# for command_result in host_result : #NEWLINE# #INDENT# for ( host , process_result ) in command_result . items ( ) : #NEWLINE# #INDENT# assert ( process_result [ 'returncode' ] == 0 ) , process_result [ 'stderr' ] #NEWLINE# assert ( host in host_port ) #NEWLINE# assert ( '/usr/bin/scp' in process_result [ 'cmd' ] ) #NEWLINE# assert ( '-r' in process_result [ 'cmd' ] ) #NEWLINE# assert ( ( workspace + '/recursive_pilot.txt' ) in process_result [ 'cmd' ] )