-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filestore: Update README and add testcase using new add-ss functionally
With the new "add-ss" command it is now possible to add files to the filestore with the daemon online. Update README to reflect this fact and create some new test cases to test the new functionally. License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
- Loading branch information
Showing
2 changed files
with
74 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2014 Christian Couder | ||
# MIT Licensed; see the LICENSE file in this repository. | ||
# | ||
|
||
test_description="Test filestore" | ||
|
||
. lib/test-filestore-lib.sh | ||
. lib/test-lib.sh | ||
|
||
test_init_ipfs | ||
|
||
test_expect_success "enable API.ServerSideAdds" ' | ||
ipfs config API.ServerSideAdds --bool true | ||
' | ||
|
||
test_launch_ipfs_daemon | ||
|
||
test_add_cat_file "add-ss --no-copy" "`pwd`" | ||
|
||
test_add_cat_5MB "add-ss --no-copy" "`pwd`" | ||
|
||
cat <<EOF > add_expect | ||
added QmQhAyoEzSg5JeAzGDCx63aPekjSGKeQaYs4iRf4y6Qm6w adir | ||
added QmSr7FqYkxYWGoSfy8ZiaMWQ5vosb18DQGCzjwEQnVHkTb adir/file3 | ||
added QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH adir/file1 | ||
added QmZm53sWMaAQ59x56tFox8X9exJFELWC33NLjK6m8H7CpN adir/file2 | ||
EOF | ||
|
||
test_expect_success "testing add-ss -r --no-copy" ' | ||
mkdir adir && | ||
echo "Hello Worlds!" > adir/file1 && | ||
echo "HELLO WORLDS!" > adir/file2 && | ||
random 5242880 41 > adir/file3 && | ||
ipfs add-ss --no-copy -r "`pwd`/adir" | LC_ALL=C sort > add_actual && | ||
test_cmp add_expect add_actual && | ||
ipfs cat QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH > cat_actual | ||
test_cmp adir/file1 cat_actual | ||
' | ||
|
||
test_kill_ipfs_daemon | ||
|
||
test_done |