Changeset 27512 for gs2-extensions
- Timestamp:
- 2013-05-30T10:16:22+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/parallel-building/trunk/src/bin/script/test_fileutils.pl
r27481 r27512 67 67 # populate globals 68 68 $base_path = $ENV{'GEXTPARALLELBUILDING'}; 69 70 # SPECIAL TESTS 71 if (defined $ARGV[0]) 72 { 73 if ($ARGV[0] eq "-buffersize") 74 { 75 print STDERR "Exploring the affect of ThriftBuffer size on transfer speed\n"; 76 my $filename = 'WekaManual-3-6-7.pdf'; 77 my $local_path = $base_path . '/resources/' . $filename; 78 my $thrift_path = 'HDThriftFS:///user/' . $user. '/' . $filename; 79 my $tmp_path = '/tmp/' . $filename; 80 print STDERR " - copying " . $filename . " (" . &FileUtils::fileSize($local_path) . " bytes)\n"; 81 $start_time = time(); 82 print STDERR " - copy to Thrift... "; 83 &FileUtils::copyFiles($local_path, $thrift_path); 84 print STDERR "Done in " . (time() - $start_time) . " seconds\n"; 85 $start_time = time(); 86 print STDERR " - copy from Thrift..."; 87 &FileUtils::copyFiles($thrift_path, $tmp_path); 88 print STDERR "Done in " . (time() - $start_time) . " seconds\n"; 89 my $result = `diff "$local_path" "$tmp_path"`; 90 $test_count = 0; 91 &testAction(\$test_count, "Comparing binary files (roundtrip)", '', $result); 92 &FileUtils::removeFiles($thrift_path); 93 &FileUtils::removeFiles($tmp_path); 94 exit; 95 } 96 } 69 97 70 98 print "\n"; … … 261 289 sub testBinaryTransfer 262 290 { 263 my ($dir, $base_dir) = @_; 291 my ($dir, $base_dir, $file) = @_; 292 if (!defined $file) 293 { 294 $file = 'aurora_australus.jpg'; 295 } 264 296 # setup 265 my $local_image_path = $base_path . '/resources/aurora_australus.jpg'; 266 my $thrift_copy_path = $dir . '/test_binary_transfer.jpg'; 267 my $local_copy_path = '/tmp/test_binary_transfer.jpg'; 297 my ($extension) = $file =~ /\.([^\.]+)$/; 298 my $local_image_path = $base_path . '/resources/' . $file; 299 my $thrift_copy_path = $dir . '/test_binary_transfer.' . $extension; 300 my $local_copy_path = '/tmp/test_binary_transfer.' . $extension; 268 301 # actions - roundtrip copy of files 269 302 &FileUtils::copyFiles($local_image_path, $thrift_copy_path);
Note:
See TracChangeset
for help on using the changeset viewer.