Commit Graph

260 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ø
f2dd060e4a Don't use wildcards to look for .go files in tests makefile
GNU Make's wildcard function does not recurse into subdirectories when
passed the '**' glob, which results in adding a dependency only to .go
files in the first level of subdirectories under the source root.

We shell out to 'find' instead, which catches all .go files in the
given directory.
2015-04-07 21:22:04 +02: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
Tor Arne Vestbø
d36a9eef2b Ensure IPFS-BUILD-OPTIONS build dependency is created
If the file doesn't exist, make will conclude that the missing
prerequisite should trigger a rebuild of the binaries.
2015-04-07 21:09:45 +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
Jeromy
8540f2da80 Add benchmark for just the time it takes to cat 2015-04-06 16:57:52 -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
Christian Couder
61550d08be test: add IPFS-BUILD-OPTIONS to .gitignore
...and remove bin/* stuff from the .gitignore
as /test/bin is already in the root .gitignore.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-06 18:06:24 +02:00
Christian Couder
3edd3227fe test: add test_race target to Makefile
This builds go binaries using the -race flag
and then runs all the tests.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-06 18:06:24 +02:00
Christian Couder
7edfc784ac test: add GOFLAGS variable to the Makefile
This makes it possible to build binaries with
different flags.

The content of the GOFLAGS variable is stored
in a IPFS-BUILD-OPTIONS file, so that if GOFLAGS
changes a rebuild of the binaries with the new
flags is forced.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-06 18:05:47 +02:00
Christian Couder
a2c41e650d test/bin: add checkflags to detect flag changes
This script can be used in a Makefile to detect flag changes
and to save the new flags in a file.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-06 17:59:49 +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
1f1507106a test: implement test_sort_cmp()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-04 07:37:37 +02:00
Christian Couder
d0d1456ee1 test/README: update sharness test coverage 2015-04-02 11:56:49 +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
Juan Batiz-Benet
039526b93c Merge pull request #953 from jbenet/t0090_add_offline_tests
t0090: test ipfs get offline as well as online
2015-03-21 17:50:15 -07:00
Christian Couder
32a2403908 test: add README with sharness test command coverage
See issue #906 (sharness test command coverage) that
discussed this.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-21 09:30:45 +01: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
5b4f4328fd 3nodetest: dont fail because of logs 2015-03-18 02:11:45 -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
6cc0a6b1de test/bin: fix continueyn on Linux
It looks like there were two problems:

- "read" command probably needs the name of the variable
  it reads into

- [[ didn't work

This might be because on Linux /bin/sh is sometimes not
bash. For example on Ubuntu it is a symlink to dash.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-03-16 20:02:02 +01:00
Juan Batiz-Benet
36e6286560 Merge pull request #929 from jbenet/t0051_fix_indentation
t0051: fix indentation
2015-03-16 01:30:10 -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
Tommi Virtanen
fdd1cd8dc0 Remove fsrepo.At, make Open a constructor function
Nobody calls At without immediately calling Open.

First step, a mechanical transformation. Cleanups will follow.
2015-03-13 20:19:03 -07: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