Commit Graph

401 Commits

Author SHA1 Message Date
Jeromy
ab0c668ab8 fix panic caused by accessing config after repo closed
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-03 09:28:36 -07:00
Juan Benet
dfa27c0c5a Merge pull request #1623 from rht/fix-check-api-test
Fix and refactor daemon api test
2015-09-02 22:42:09 +02:00
Juan Benet
a3f0a6eb73 Merge pull request #1625 from ipfs/check-peerid
t0020: simplify peerid check
2015-09-02 22:41:13 +02:00
Juan Benet
5ff766bea9 Merge pull request #1626 from ipfs/t0062-cleanup
t0062 cleanup
2015-09-02 22:40:10 +02:00
Jeromy
a4e72871fa add tests for symlinks
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-02 12:59:09 -07:00
Christian Couder
dc68ae76e3 t0020: simplify peerid check
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-08-30 18:23:03 +02:00
Christian Couder
3562e72d8e t0062: add missing && in test_client*()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-08-29 22:30:37 +02:00
Christian Couder
cbeff099a2 t0062: check that 'ipfs config' works
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-08-29 22:28:58 +02:00
Christian Couder
fe742050ac t0062: use "$@" directly
This avoids potential quoting problems.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-08-29 22:23:55 +02:00
rht
1198564ca3 Fix and refactor daemon api test
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-29 22:10:58 +07:00
Juan Benet
8c652907de Merge pull request #1598 from ipfs/check-for-api
check for API -- WIP
2015-08-29 06:20:59 +02:00
Juan Batiz-Benet
8c547ff7b8 t0062-daemon-api.sh tabs
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-29 06:13:50 +02:00
Juan Batiz-Benet
b883381b63 improved t0062-daemon-api.sh tests
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-29 06:12:12 +02:00
Juan Benet
9f253dfa7a Merge pull request #1592 from prusnak/empty-repo
Add --empty-repo option for init (#1559)
2015-08-28 14:13:09 +02:00
rht
be96d8d7d5 Fix test cases for ipfs api check
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-28 13:20:13 +07:00
Christian Couder
e1d8200ffb test-lib: use all the test_launch_ipfs_daemon() arguments
It is simpler and less error prone to just pass to `ipfs daemon`
all the arguments that are passed to test_launch_ipfs_daemon().

Maybe the arguments should be shell quoted too, but that's
another issue.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-08-28 05:17:27 +02:00
Jeromy
94000e6490 replace nodebuilder with a nicer interface
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

use NewNode instead of NewIPFSNode in most of the codebase

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

make mocknet work with node constructor better

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

finish cleanup of old construction method

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

blockservice.New doesnt return an error anymore

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

break up node construction into separate function

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

add error case to default filling on node constructor

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-08-27 08:43:10 -07:00
rht
dd265b7f03 Add test cases for ipfs api check
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-27 18:30:28 +07:00
Christian Couder
872daf8357 t0020: add test for --empty-repo
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-08-25 21:26:06 +02:00
Juan Benet
0f9065963f Merge pull request #1599 from ipfs/binary-data-and-json
Binary data and json test
2015-08-25 16:18:31 +02:00
Christian Couder
5cced6f21a t0051: check json i/o
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-08-24 23:13:55 +02:00
Christian Couder
e4a0a3bfcb t0051: add UTF-8 test file
This new file comes from:

https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt

It is licensed under CC BY 4.0.

After discussing that with its author, I think it is ok to
add it as is to our repository. The only restriction might
be that we should indicate in the file any change we make
to it.

License: CC BY 4.0
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-08-24 23:05:48 +02:00
Juan Benet
a052087974 Merge pull request #1569 from rht/daemon-msg
Notify when daemon is ready
2015-08-23 05:11:27 +02:00
Christian Couder
dd6fe10f02 t0042: fix test indentation
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-08-21 20:29:18 +02:00
rht
90b6490a35 Add test for readonly gateway api sanitation
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-17 15:07:31 +07:00
Karthik Bala
d140b8aae1 Add router that does nothing for bitswap_wo_routing test
License: MIT
Signed-off-by: Karthik Bala <karthikbala444@gmail.com>
2015-08-16 16:42:08 -07:00
rht
dd99a70a7d Add readonly api to gateway
Based on https://github.com/ipfs/go-ipfs/pull/1389

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-15 17:08:59 +07:00
Stephan Seidt
afbdedb469 config set: test setting with null & not-defined parent
This adds a failing for the case described in #1561

License: MIT
Signed-off-by: Stephan Seidt <evilhackerdude@gmail.com>
2015-08-13 19:41:41 +07:00
rht
35ab1e347b Notify when daemon is ready
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-13 09:51:52 +07:00
Juan Batiz-Benet
978c9fa16f cmds/add: use dagutils.Editor, like patch
This changes the pin behavior. It uses the filenames given through
the api, and allows files to be streamed faltly (not a hierarchy),
which is easier for other things (like vinyl in node-ipfs-api land).
Files can also be entirely out of order, and the garbage intermediate
directories will not be pinned (gc-ed later).

The changes also mean the output of add has changed slightly-- it
no longer shows the local path added, but rather the dag path
relative to the added roots. This is a small difference, but changes
tests.

The dagutils.Editor creates a lot of chaff (intermediate objects)
along the way. Wonder how we might minimize the writes to the
datastore...

This commit also removes the "NilRepo()" part of the --only-hash
mode. We need to store at least in an in-mem repo/datastore because
otherwise the dagutils.Editor breaks.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-12 08:24:06 +02:00
Juan Batiz-Benet
f105ce439f get: fix bug + improvements
up until now there has been a very annoying bug with get, we would
get halting behavior. I'm not 100% sure this commit fixes it,
but it should. It certainly fixes others found in the process of
digging into the get / tar extractor code. (wish we could repro
the bug reliably enough to make a test case).

This is a much cleaner tar writer. the ad-hoc, error-prone synch
for the tar reader is gone (with i believe was incorrect). it is
replaced with a simple pipe and bufio. The tar logic is now in
tar.Writer, which writes unixfs dag nodes into a tar archive (no
need for synch here). And get's reader is constructed with DagArchive
which sets up the pipe + bufio.

NOTE: this commit also changes this behavior of `get`:
When retrieving a single file, if the file exists, get would fail.
this emulated the behavior of wget by default, which (without opts)
does not overwrite if the file is there. This change makes get
fail if the file is available locally. This seems more intuitive to
me as expected from a unix tool-- though perhaps it should be
discussed more before adopting.

Everything seems to work fine, and i have not been able to reproduce
the get halt bug.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-05 09:50:33 +02:00
Juan Batiz-Benet
741cf7e793 sharness/t009-get: fix space/tabs
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-05 09:47:58 +02:00
Juan Batiz-Benet
b858928662 unixfs/tar: cleaned up reader code
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-05 09:46:58 +02:00
Juan Batiz-Benet
5f59556ff9 add -w comprehensive tests
made many more tests for ipfs add -w

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-29 04:08:08 -07:00
Juan Batiz-Benet
431d6a5a14 added random-files tool for testing
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-29 03:18:24 -07:00
Juan Batiz-Benet
6e6badf105 add -w: fix to work correctly with dirs.
this commit changes the behavior of ipfs add -w:

- it makes it able to work with ipfs add -r <dir>
- instead of hacking around the add, we simply just add a wrapper
  directory around the whole result of the add. this means that
  ipfs add -w calls will output _two_ lines, but this is actually
  more correct than outputting one line, as two objects were added.
  this _may_ break scripts out there which expect the output to
  look a certain way. we should consider whether the old output is
  more _useful_ (even if less in-line with the model.)

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-29 02:30:08 -07:00
Jeromy
314f7bbfea space out sharness test calls
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 15:00:07 -07:00
Jeromy
194eb7c0dc more tests and better path handling in object
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 15:00:07 -07:00
Jeromy
bfe4e4be4f let rm understand paths
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 15:00:07 -07:00
Jeromy
870df2431a allow patch to optionally create intermediate dirs
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 15:00:07 -07:00
Shaun Bruce
c175700dea Better error message on unrecognized command
Closes issue #1436

License: MIT
Signed-off-by: Shaun Bruce <shaun.m.bruce@gmail.com>
2015-07-28 09:20:53 -06:00
Juan Batiz-Benet
490ed41c45 sharness/ipfs refs bigger tests
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 06:14:20 -07:00
gatesvp
8fe7d2f571 Fix refs -r -u for #1211
License: MIT
Signed-off-by: Gaetan Voyer-Perrault <gatesvp@gmail.com>
2015-07-28 06:14:20 -07:00
Juan Batiz-Benet
a5521fcc76 sharness/repo: fix pinning test
looks like the test was broken by GC-ing everything.
the pin expects $HASH to still be there.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 06:14:13 -07:00
rht
eb45082103 Add reversible gc test
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-28 09:47:15 +07:00
Jeromy
138198e786 print output on test failure for t0081
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-27 18:34:37 -07:00
Jeromy
bb3a75aa08 remove context from context
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-20 20:53:06 -07:00
Jeromy
f9f3c6a527 make offline commands respect timeout
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-20 14:34:16 -07:00
Jeromy
5711eb8cd9 better test of failure case
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-14 13:28:22 -07:00
Jeromy
4cce6f8adf add sharness test to check object stat with no leading /ipfs/
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-14 12:28:38 -07:00