#!/bin/sh # Copyright (c) 2009 Chris Miceli (cmicel1@cct.lsu.edu) # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # Header while getopts d arg do case $arg in d) echo -n "This program tests the functionality of the globus file copy and cat." exit 0;; esac done # Create a dummy temporary file TMPFILE=`mktemp -t saga.adaptor.XXXXXX` || exit 1 # Verify existence if ! test -e $TMPFILE then echo "Could not create temporary file!" exit 1 fi # Give the file some contents `echo "Hello Saga" > $TMPFILE` # Run a remote echo test and put result in tmp file `$SAGA_LOCATION/bin/saga-file copy file://localhost/$TMPFILE gridftp://$REMOTEHOST/` # Try to cat the file using ssh RESULT=`$SAGA_LOCATION/bin/saga-file cat gridftp://$REMOTEHOST/$TMPFILE` # Clean up temporaries rm $TMPFILE `$SAGA_LOCATION/bin/saga-file remove gridftp://$REMOTEHOST/$TMPFILE` # Verify the cat exited what was expected if test "$RESULT" != "Hello Saga" then echo "Saga could not succesfully cat the file!" exit 1 else echo "Success" exit 0; fi