@@ -1,8 +1,8 @@
# $FreeBSD$
PIDFILE=ggated.pid
TESTURL=http://127.0.0.1:5555/somefile
TESTFILE=/home/freebsd/lf.test/webdav/data/somefile
TESTURL="$GGATEHTTP_URL"
TEMPFILE="random.data"
atf_test_case ggatehttp cleanup
ggatehttp_head()
@@ -19,8 +19,10 @@ ggatehttp_body()
us=$(alloc_ggate_dev)
src=$(alloc_md)
n1mchunks=10
atf_check -e ignore -o ignore \
dd if=/dev/random of="$TESTFILE" bs=1m count=1 conv=notrunc
dd if=/dev/random of="$TEMPFILE" bs=1m count=$n1mchunks conv=notrunc
atf_check ggatehttp create -u $us "$TESTURL"
@@ -28,20 +30,20 @@ ggatehttp_body()
wait_for_ggate_device ${ggate_dev}
# Test read ing
# Test writ ing
atf_check -e ignore -o ignore \
dd if=${ggate_dev} of=/dev/${src} bs=1m count=1 conv=notrunc
checksum /dev/$src "$TESTFILE"
dd if="$TEMPFILE" of=${ggate_dev} bs=1m count=$n1mchunks conv=notrunc
# Test reading
atf_check -e ignore -o ignore \
dd if=/dev/random of=/dev/${src} bs=1m count=1 conv=notrunc
dd of="$TEMPFILE"2 if=${ggate_dev} bs=1m count=$n1mchunks conv=notrunc
# Test writing
atf_check -e ignore -o ignore \
dd if=/dev/${src} of=${ggate_dev} bs=1m count=1 conv=notrunc
ls -l "$TEMPFILE" "$TEMPFILE"2
# Verify that we read what we wrote
atf_check cmp "$TEMPFILE" "$TEMPFILE"2
checksum /dev/$src "$TESTFILE"
rm "$TEMPFILE" "$TEMPFILE"2
}
ggatehttp_cleanup()