Commit d2dfee70 authored by Niels Möller's avatar Niels Möller
Browse files

Test cases for lcp.

Rev: src/testsuite/lcp-test:1.1
parent 91a2501b
#! /bin/sh
echo testing lcp
if [ -z "$srcdir" ] ; then
srcdir=`pwd`
fi
. $srcdir/functions.sh
spawn_lshd || test_fail
spawn_lsh -G || test_fail
rm -rf "$TEST_HOME"/files
mkdir "$TEST_HOME"/files
LCP_RSH=../lshg
export LCP_RSH
LCP="$srcdir/../lcp"
echo foo > lcp-file-1.txt
echo bar > lcp-file-2.txt
# Copy from local files to remote files
$LCP lcp-file-1.txt localhost:files || die "lcp failed, 1"
cmp lcp-file-1.txt "$TEST_HOME/files/lcp-file-1.txt" || die "files differ, 2"
$LCP lcp-file-1.txt localhost:files && die "lcp to existing file succeeded, 3"
$LCP lcp-file-2.txt localhost:files/lcp-file-1.txt && die "lcp to existing file succeeded, 4"
$LCP -f lcp-file-2.txt localhost:files/lcp-file-1.txt || die "lcp -f to existing file failed, 5"
cmp lcp-file-2.txt "$TEST_HOME/files/lcp-file-1.txt" || die "files differ, 6"
# Copy from remote files to local directory
$LCP localhost:files/lcp-file-1.txt . && die "lcp to existing file succeeded, 11"
echo baz > lcp-file-1.txt
$LCP -f localhost:files/lcp-file-1.txt . || die "lcp -f to existing file failed, 12"
cmp lcp-file-1.txt "$TEST_HOME/files/lcp-file-1.txt" || die "files differ, 13"
rm -f lcp-file-3.txt
$LCP localhost:files/lcp-file-1.txt lcp-file-3.txt || die "lcp failed, 14"
cmp "$TEST_HOME/files/lcp-file-1.txt" lcp-file-3.txt || die "files differ, 15"
test_success
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment