Skip to content

Commit

Permalink
updating test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
chmduquesne committed Aug 5, 2011
1 parent 8e1ae61 commit 8656e0a
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions tests/test_suite
Expand Up @@ -23,5 +23,74 @@ fuse()
clean
}

sync_simple()
{
echo "simple synchronization"
init local
init remote
mount local
mount remote
make_peers local remote
echo "test" >> sandbox/local/mnt/test_file
echo "pull remote" > sandbox/local/mnt/.command
# after sync, the file must exist
assert_success test -e test/remote/mnt/test_file
# but diffing should fail because it is recorded as size 0
assert_fail diff test/local/mnt/test_file test/remote/mnt/test_file
# diffing should work the second time (opened by the first diff, so it
# has been downloaded)
assert_success diff test/local/mnt/test_file test/remote/mnt/test_file
debug_interrupt
unmount local
unmount remote
clean
}

sync_normal_conflict()
{
echo "synchronization with normal conflict"
init local
init remote
mount local
mount remote
make_peers local remote
echo "test_line" >> test/local/mnt/test_file
./sharebox.py -c sync test/remote/mnt
assert_success test -e test/remote/mnt/test_file
touch test/remote/mnt/test_file
echo "test_line_local" >> test/local/mnt/test_file
echo "test_line_remote" >> test/remote/mnt/test_file
./sharebox.py -c sync test/remote/mnt
# but diffing should fail
assert_fail diff test/local/mnt/test_file test/remote/mnt/test_file
debug_interrupt
unmount local
unmount remote
clean
}

sync_delete_conflict()
{
echo "synchronization with delete conflict"
init local
init remote
mount local
mount remote
make_peers local remote
echo "test_line" >> test/local/mnt/test_file
./sharebox.py -c sync test/remote/mnt
assert_success test -e test/remote/mnt/test_file
touch test/remote/mnt/test_file
echo "test_line_remote" >> test/remote/mnt/test_file
rm test/local/mnt/test_file
./sharebox.py -c sync test/remote/mnt
# diffing should fail
assert_fail diff test/local/mnt/test_file test/remote/mnt/test_file
debug_interrupt
unmount local
unmount remote
clean
}

mount_unmount
fuse

0 comments on commit 8656e0a

Please sign in to comment.