1 #!/usr/bin/perl -IOpen-ILS/src/perlmods/lib/
3 use strict; use warnings;
7 use OpenILS::Utils::RemoteAccount;
12 remote_host => 'example.org',
13 remote_user => 'some_user',
14 remote_password => 'some_user',
15 remote_file => './out/testfile',
20 return <<END_OF_CONTENT;
22 This is a test file sent at:
28 my $x = OpenILS::Utils::RemoteAccount->new(
29 remote_host => $config{remote_host},
30 remote_user => $config{remote_user},
34 $Data::Dumper::Indent = 1;
37 $delay and print "Sleeping $delay seconds\n" and sleep $delay;
40 remote_file => $config{remote_file} . "1.$$",
42 }) or die "ERROR: $x->error";
44 print "\n\n", Dumper($x);
46 my $file = $x->local_file;
47 open TEMP, "< $file" or die "Cannot read tempfile $file: $!";
48 print "\n\ncontent from tempfile $file:\n";
49 while (my $line = <TEMP>) {
54 print "\n\nls :\n", join "\n", $x->ls;
55 print "\n\nls ('out'):\n", join "\n", $x->ls('out');
57 print "\nThis one should fail (at put)\n";
60 $y = OpenILS::Utils::RemoteAccount->new(
61 remote_host => $config{remote_host},
62 remote_user => $config{remote_user},
63 remote_password => 'some_junk',
67 print STDERR "ERROR: $@ $! : \n", $y->error, "\n";
69 print "\n\n", Dumper($y);
71 $delay and print "Sleeping $delay seconds\n" and sleep $delay;
73 remote_file => $config{remote_file} . "2.$$",
75 }) or warn "ERROR with put: " . $y->error;
77 print "\nThis one might succeed\n";
79 remote_file => $config{remote_file} . "3.$$",
81 remote_password => $config{remote_password},
82 }) or warn "ERROR with put: " . $y->error;