Commit Graph

280 Commits

Author SHA1 Message Date
Juan Batiz-Benet
cc5f6bb306 Merge pull request #1156 from ipfs/maintenance
Godeps maintenance
2015-04-29 12:28:03 -07:00
Vitor Baptista
5d1a25bbb9 core/commands: pin ls: display types by default
If you want to get only the hashes (i.e. the previous behaviour), you can use
the `--quiet` flag.
2015-04-28 19:15:15 +01:00
Henry
7a6febbe38 godeps: following up on PR #1098 to drop the facebookgo code
I want to follow this up with a thorough execution of my x/tool/cmd/eg experiments (https://github.com/ipfs/go-ipfs/compare/errRampage)
2015-04-28 13:42:23 +02:00
Juan Batiz-Benet
29c6a53e43 Merge pull request #1139 from AtnNn/flags
Improve command line parsing
2015-04-27 16:21:39 -07:00
Etienne Laurin
f168539030 Improve command line parsing 2015-04-27 17:19:38 +00:00
Jeromy
6da12b5398 address comments from CR 2015-04-26 22:32:12 -07:00
Jeromy
2c1c48a165 Add iptb sharness test for multi-ipns name resolution 2015-04-26 22:32:12 -07:00
Jeromy
3d80b9d27d refactored ipns records to point to paths
Also changed the ipns dns resolution to use the "dnslink" format
2015-04-26 22:32:12 -07:00
Christian Couder
cfcc7c6839 test/Makefile: add bin/iptb into BINS
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-26 17:28:31 +02:00
Christian Couder
ad67f18dc8 t0130: small improvements
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-26 17:26:51 +02:00
Jeromy
89ff6dfdaa add clone of 3node test using iptb instead of docker
rename directory and update vendored dep

cleanup
2015-04-22 21:25:52 -07:00
Juan Batiz-Benet
960de83683 Merge pull request #1112 from ipfs/encapsulate_ipfs_mount
sharness: encapsulate ipfs mount
2015-04-21 22:24:49 -07:00
Christian Couder
14cd8634ef test-lib.sh: fix umount calls
As test directories contain a space, we need to
properly quote paths, otherwise we get errors like:

```
umount: /home/christian/gocode/src/github.com/ipfs/go-ipfs/test/sharness/trash is not mounted (according to mtab)
umount: /home/christian/gocode/src/github.com/ipfs/go-ipfs/test/sharness/trash is not mounted (according to mtab)
```

instead of:

```
umount: /home/christian/gocode/src/github.com/ipfs/go-ipfs/test/sharness/trash directory.t0030-mount.sh/ipfs is not mounted (according to mtab)
umount: /home/christian/gocode/src/github.com/ipfs/go-ipfs/test/sharness/trash directory.t0030-mount.sh/ipns is not mounted (according to mtab)
```

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-21 16:18:35 +02:00
Christian Couder
cc6eabf49f t0030: expect good ipfs mount output
As the ipfs mount call is now encapsulated in a
temporary function (see previous commit) its
output should not be tempered with by
test_must_fail.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-21 16:00:07 +02:00
Christian Couder
a7b0227029 t0030: encapsulate ipfs mount
As described in issue #1109 on OSX some output from
test_must_fail unfortunately goes into the "output"
file that we use to test the output from "ipfs mount".

This patch avoids the above by encapsulating the call
to "ipfs mount" into a temporary function.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-21 15:55:20 +02:00
Juan Batiz-Benet
cf797d3d02 sharness: only send kill signal once - #1106
sharness should only send the kill signal once, as that is
what a graceful shutdown should do. in the event that doesn't
happen, we should send it again, and then kill -9 to prevent it
lingering and messing with other tests.
2015-04-21 01:15:22 -07:00
Juan Batiz-Benet
bd9e2c6edb sharness: t0030-mount output known breakage
The test_must_fail check fails on osx. (it does not seem to fail on
linux). See #1109
2015-04-21 01:15:14 -07:00
Travis Person
676fd50ca0 Correctly written test for ipfs init with daemon 2015-04-20 23:46:59 -07:00
Travis Person
e7756e45f9 Problem with initializing daemon on same port
At this point I think this test should be moved out of this file
2015-04-20 19:33:41 -07:00
Travis Person
cca5212e09 Add sharness test
This test to make sure we can't run `ipfs init` while a daemon is
currently running.
2015-04-20 18:35:42 -07:00
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