Commit Graph

115 Commits

Author SHA1 Message Date
Christian Couder
96a22c5bb1 config: change default config dir name to .ipfs
This changes .go-ipfs to .ipfs everywhere.
And by the way this defines a DefaultPathName const
for this name.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-20 02:25:41 -07:00
Jeromy
ef56f4f83b functions dont need to be called functions 2015-04-19 23:40:25 -07:00
Jeromy
0a6b880bee fix for #1008 and other pinning fixes
This commit adds a new set of sharness tests for pinning, and addresses
bugs that were pointed out by said tests.

test/sharness: added more pinning tests

Pinning is currently broken. See issue #1051. This commit introduces
a few more pinning tests. These are by no means exhaustive, but
definitely surface the present problems going on. I believe these
tests are correct, but not sure. Pushing them as failing so that
pinning is fixed in this PR.

make pinning and merkledag.Get take contexts

improve 'add' commands usage of pinning

FIXUP: fix 'pin lists look good'

ipfs-pin-stat simple script to help check pinning

This is a simple shell script to help check pinning.

We ought to strive towards making adding commands this easy.
The http api is great and powerful, but our setup right now
gets in the way. Perhaps we can clean up that area.

updated t0081-repo-pinning

- fixed a couple bugs with the tests
- made it a bit clearer (still a lot going on)
- the remaining tests are correct and highlight a problem with
  pinning. Namely, that recursive pinning is buggy. At least:
  towards the end of the test, $HASH_DIR4 and $HASH_FILE4 should
  be pinned indirectly, but they're not. And thus get gc-ed out.
  There may be other problems too.

cc @whyrusleeping

fix grep params for context deadline check

fix bugs in pin and pin tests

check for block local before checking recursive pin
2015-04-19 23:40:25 -07:00
Etienne Laurin
233c39ff62 publish by path 2015-04-12 21:51:58 +00:00
Tor Arne Vestbø
7b49419d93 Fix dependencies in sharness test makefile
Running make -jN would result in the tests starting to execute
before the tests binaries were built, resulting in the error:

 "Cannot find the tests' local ipfs tool"

Each test now depends on the deps. They also depend on a new
target for cleaning the test results, so that the tests can
write new clean results.

The aggregate target also needs to depend on the same test
results clean target, as well as the tests themselves, so
that the aggregation happens when all tests have finished
running.

By introducing a separate target for cleaning test results we
also ensure that we don't end up removing and rebuilding
the binary on each test run.

The result is that the tests *can* be run with with -jN > 1,
but individual tests may still not supports this, so to get
stable test results it's still recommended to run them in
sequence.
2015-04-07 21:21:58 +02:00
Juan Batiz-Benet
f2aba08c9a Merge pull request #1024 from ipfs/run_tests_with_race_flag2
Run tests with race flag using checkflags script
2015-04-07 04:18:54 -07:00
Jeromy
7727309e89 disable archive test 2015-04-06 21:37:48 -07:00
Christian Couder
dbf91a19a1 test/sharness: add GOFLAGS variable and race target
The GOFLAGS variable makes it possible to run all sharness
tests with go binaries built with some special flags.

The "race" target makes it easy run the sharness tests
with go binaries built with the -race flag.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-06 18:06:24 +02:00
theswitch
000de03000 Correct port in quick-start examples 2015-04-06 12:39:06 +10:00
Christian Couder
c2e9a08098 t0080: use test_sort_cmp()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-04 07:43:59 +02:00
Christian Couder
72b20017ca t0060: add tests for version and help commands
As `ipfs version` and `ipfs help` are basic commands
it is ok to test them online in t0060.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-01 14:56:06 +02:00
Konstantin Koroviev
490c88599d t0030-mount.sh: improve stdout stderr fail tests 2015-03-31 22:55:36 -07:00
Christian Couder
e0c4638496 t0030: replace some expect_failure with expect_success
It looks like some tests that were expected failures
are now always succeeding, so let's mark them as such.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-31 17:26:22 -07:00
Ho-Sheng Hsiao
bf22aeec0a Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00
Juan Batiz-Benet
8a533be02f Merge pull request #977 from jbenet/t0051_add_online_tests
t0051: test ipfs object online as well as offline
2015-03-29 14:44:15 -07:00
Christian Couder
327c59f7f0 t0051: test ipfs object online as well as offline
To do that the current tests are move inside a
test_object_cmd() function. This function is then first
called before running the daemon for offline tests
and then after starting the daemon for online tests.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-29 18:32:51 +02:00
Christian Couder
02dfb9f8ea t0045: test ipfs ls online as well as offline
To do that the current tests are move inside a
test_ls_cmd() function. This function is then first
called before running the daemon for offline tests
and then after starting the daemon for online tests.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-29 17:46:27 +02:00
Christian Couder
c60163183a t0090: test ipfs get offline as well as online
To do that the current tests are move inside a
test_get_cmd() function. This function is then first
called before running the daemon for offline tests
and then after starting the daemon for online tests.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-21 09:14:24 +01:00
Henry
07008042f1 ipfs ls: added --headers option
- added tests for 'ipfs ls --headers'
- comments from CR (opts)
- sharness: fix ls test whitespace
2015-03-20 15:34:56 -07:00
Konstantin Koroviev
d70912fff1 t0060-daemon.sh: Add 1 test 2015-03-19 16:38:22 +02:00
Jeromy
3bf7d5c27e test for pinning semantics 2015-03-18 22:38:57 -07:00
Juan Batiz-Benet
edbca27019 sharness/t0110-gateway: fix /s fail on osx
the test cases were failing for me on osx. Removing /s fixes them.
It should be fine not to check the /s.
2015-03-17 06:06:00 -07:00
Christian Couder
ef85f67610 t0051: fix indentation
Fix indentation and use > instead of >> to create
an expected file.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-15 17:00:09 +01:00
Juan Batiz-Benet
90d2113f99 Merge pull request #896 from jbenet/t0060_reactivate_daemon_tests
t0060: reactivate daemon tests
2015-03-10 15:55:52 -07:00
Henry
b688e72de0 ipfs object put: return error if object is empty (fixes #883) 2015-03-10 22:58:50 +01:00
Juan Batiz-Benet
e06016116d Merge pull request #895 from jbenet/sharness_check_curl_response
sharness: add function to test curl response
2015-03-10 08:39:55 -07:00
Christian Couder
37bfef884c t0060: reactivate daemon tests
Tests in this script had been deactivated because
there was no good way to wait until the daemon was
ready. Now that we can use pollEndpoint for that
it's time to reactivate the tests.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-10 15:02:19 +01:00
Christian Couder
c39b5a7430 sharness: add function to test curl response
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-10 14:56:09 +01:00
Christian Couder
f67522e3f3 sharness/README: add writing tests and debugging
Add information from the discussion of PR #891.
While at it, suggest using -v and -i options to debug one test.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-10 14:51:44 +01:00
Christian Couder
60081ebc3b t0110: replace wget with curl
This removes the dependency on wget, and, while at it, cleanups a bit.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-08 08:35:44 +01:00
Christian Couder
e1a33a0e92 t0045: style cleanup and add missing &&
This makes the following changes:

- remove some superfluous \ at the end of some lines
- use `cat <<-\EOF >expected` to ignore the starting tabs
  in the here document
- add missing && after some `cat`
- use test_cmp to compare files

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-07 20:26:45 +01:00
Henry
2a0cd6d3d3 object: added sharness tests for get, put and stat 2015-03-07 16:50:30 +01:00
Christian Couder
b01e535115 t0110: cleanup using expr
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-04 21:02:32 +01:00
Juan Batiz-Benet
04a3a66c6c sharness/testlib: seed RANDOM
this is ugly. ideally would seed using date, but unclear
what a portable datetime is. date '+%s' doesnt work on osx.
2015-03-04 08:17:55 -08:00
Juan Batiz-Benet
0510633a17 tests/sharness: t0111-gateway-writable
ideally this port would be a randomly picked unused port.
for now we just pick a different port than t0110-gateway.
2015-03-04 08:17:54 -08:00
Juan Batiz-Benet
2a40d7679e test/sharness: randomize api port workaround
we have a problem where initializing daemons with the same api port
often fails-- it hangs indefinitely. The proper solution is to make
ipfs pick an unused port for the api on startup, and then use that.
Unfortunately, ipfs doesnt yet know how to do this-- the api port
must be specified. Until ipfs learns how to do this, we must use
specific port numbers, which may still fail but less frequently
if we at least use different ones.
2015-03-04 07:34:05 -08:00
Juan Batiz-Benet
999471d9bf test/sharness/t004-add-cat: quote hashes 2015-03-04 07:34:05 -08:00
Henry
aa745fef07 specify new dep in sharenss Makefile 2015-03-04 15:06:26 +01:00
Henry
0204a0c174 cat log output on fail 2015-03-04 14:53:30 +01:00
Henry
56a32a306c using pollEndpoint to block in tests for 'daemon ready' (updates #844) 2015-03-04 14:50:17 +01:00
Juan Batiz-Benet
9f27556090 Merge pull request #823 from BrendanBenshoof/master
fixing bug 812
2015-03-02 17:02:24 -08:00
bbenshoof
ed179263f4 split the tests 2015-03-02 17:55:01 -05:00
Juan Batiz-Benet
8ec5182186 Merge pull request #838 from jbenet/t0111_fix_double_quoting
t0111: fix broken test due to bad double quoting
2015-03-02 14:35:14 -08:00
bbenshoof
ac5cfc5664 fixing bug 812 2015-03-02 17:07:21 -05:00
Henry
220aaf2802 sharness: don't be to smart about creating testData 2015-03-01 14:03:51 +01:00
Henry
9cf718932e ipfs ls: make sure to fully create testData 2015-03-01 14:03:51 +01:00
Henry
f5f5d5d9d2 newIpfsLs: add shareness test 2015-03-01 14:03:51 +01:00
Christian Couder
17ca4f6429 t0111: use expr again to check location
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-28 18:27:54 +01:00
Christian Couder
f82526a5ca t0111: use URL variable to clarify code
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-28 08:21:55 +01:00
Christian Couder
d9d758cfde t0111: use "expr" more to check Location
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-28 08:14:15 +01:00