Commit 09d611fb authored by Philip Carns's avatar Philip Carns

test case for bb-copy-from

- doesn't work yet, need to implement bake_bulk_read
parent 980bb0c7
Pipeline #385 skipped
......@@ -51,7 +51,7 @@ int main(int argc, char **argv)
return(-1);
}
ret = bake_probe_instance(argv[2], &bti);
ret = bake_probe_instance(argv[1], &bti);
if(ret < 0)
{
ABT_finalize();
......@@ -59,10 +59,10 @@ int main(int argc, char **argv)
return(-1);
}
region_fd = open(argv[1], O_RDONLY);
region_fd = open(argv[2], O_RDONLY);
if(region_fd < 0)
{
perror("open");
perror("open rid");
bake_release_instance(bti);
ABT_finalize();
return(-1);
......@@ -80,7 +80,7 @@ int main(int argc, char **argv)
close(region_fd);
ret = bake_bulk_get_size(bti, rid, &check_size);
if(ret != sizeof(rid))
if(ret != 0)
{
fprintf(stderr, "Error: bake_bulk_get_size()\n");
bake_release_instance(bti);
......@@ -88,10 +88,10 @@ int main(int argc, char **argv)
return(-1);
}
fd = open(argv[3], O_WRONLY|O_TRUNC);
fd = open(argv[3], O_WRONLY|O_TRUNC|O_CREAT, S_IRUSR|S_IWUSR);
if(fd < 0)
{
perror("open");
perror("open output");
bake_release_instance(bti);
ABT_finalize();
return(-1);
......
TESTS += \
tests/basic.sh \
tests/copy-to.sh
tests/copy-to-and-from.sh
EXTRA_DIST += \
tests/basic.sh \
tests/copy-to.sh
tests/copy-to-and-from.sh
......@@ -13,13 +13,22 @@ test_start_servers 1 2 20
#####################
echo "Hello world." > $TMPBASE/foo.dat
run_to 10 src/bb-copy-to $TMPBASE/foo.dat $svr1
CPOUT=`run_to 10 src/bb-copy-to $TMPBASE/foo.dat $svr1`
if [ $? -ne 0 ]; then
run_to 10 src/bb-shutdown $svr1 &> /dev/null
wait
exit 1
fi
RID=`echo "$CPOUT" | grep -o -P '/tmp.*$'`
run_to 10 src/bb-copy-from $svr1 $RID $TMPBASE/foo-out.dat
if [ $? -ne 0 ]; then
run_to 10 src/bb-shutdown $svr1 &> /dev/null
wait
exit 1
fi
cat $TMPBASE/foo-out.dat
sleep 1
#####################
......
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