mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
git: add git plugin tests
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
parent
d6657edf59
commit
f947931af9
BIN
test/sharness/t0280-plugin-git-data/git.tar.gz
Normal file
BIN
test/sharness/t0280-plugin-git-data/git.tar.gz
Normal file
Binary file not shown.
@ -22,6 +22,36 @@ test_expect_success "copy plugin" '
|
||||
cp ../plugins/git.so "$IPFS_PATH/plugins/"
|
||||
'
|
||||
|
||||
# test here
|
||||
# from https://github.com/ipfs/go-ipld-git/blob/master/make-test-repo.sh
|
||||
test_expect_success "prepare test data" '
|
||||
tar xzf ../t0280-plugin-git-data/git.tar.gz
|
||||
'
|
||||
|
||||
test_dag_git() {
|
||||
test_expect_success "add objects via dag put" '
|
||||
find objects -type f -exec ipfs dag put --format=git --input-enc=zlib {} \; -exec echo \; > hashes
|
||||
'
|
||||
|
||||
test_expect_success "successfully get added objects" '
|
||||
cat hashes | xargs -i ipfs dag get -- {} > /dev/null
|
||||
'
|
||||
|
||||
test_expect_success "path traversals work" '
|
||||
echo \"YmxvYiA3ACcsLnB5Zgo=\" > file1 &&
|
||||
ipfs dag get z8mWaJh5RLq16Zwgtd8gZxd63P4hgwNNx/object/parents/0/tree/dir2/hash/f3/hash > out1
|
||||
'
|
||||
|
||||
test_expect_success "outputs look correct" '
|
||||
test_cmp file1 out1
|
||||
'
|
||||
}
|
||||
|
||||
# should work offline
|
||||
#test_dag_git
|
||||
|
||||
# should work online
|
||||
test_launch_ipfs_daemon
|
||||
test_dag_git
|
||||
test_kill_ipfs_daemon
|
||||
|
||||
test_done
|
||||
|
||||
Loading…
Reference in New Issue
Block a user