Commit Graph

1591 Commits

Author SHA1 Message Date
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
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
14090d4a11 moved pollEndpoint to thirdparty/ 2015-03-04 16:25:41 +01: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
Christian Couder
158affac99 t0111: use "expr" to check Location
This makes it possible to simplify the code.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-28 08:06:04 +01:00
Christian Couder
c844fffef2 t0111: fix broken test due to bad double quoting
There was basically:

  curl ... "$URL 2>curl.out"

instead of:

  curl ... "$URL" 2>curl.out

So "curl.out" was not properly overwritten by the curl command.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-27 22:09:11 +01:00
Jeromy
7fb63d7e43 move signing options into a validation checker struct 2015-02-26 22:05:03 -08:00
Jeromy
049b5ad945 make signing dht put records optional 2015-02-26 22:05:03 -08:00
Henry
92d08db7a5 rewrote import paths of go.net/context to use golang.org/x/context
- updated go-ctxgroup and goprocess
ctxgroup: AddChildGroup was changed to AddChild. Used in two files:
- p2p/net/mock/mock_net.go
- routing/dht/dht.go

- updated context from hg repo to git
prev. commit in hg was ad01a6fcc8a19d3a4478c836895ffe883bd2ceab. (context: make parentCancelCtx iterative)
represents commit 84f8955a887232b6308d79c68b8db44f64df455c in git repo

- updated context to master (b6fdb7d8a4ccefede406f8fe0f017fb58265054c)

Aaron Jacobs (2):
net/context: Don't accept a context in the DoSomethingSlow example.
context: Be clear that users must cancel the result of WithCancel.

Andrew Gerrand (1):
go.net: use golang.org/x/... import paths

Bryan C. Mills (1):
net/context: Don't leak goroutines in Done example.

Damien Neil (1):
context: fix removal of cancelled timer contexts from parent

David Symonds (2):
context: Fix WithValue example code.
net: add import comments.

Sameer Ajmani (1):
context: fix TestAllocs to account for ints in interfaces
2015-02-25 11:58:19 +01:00
Jeromy
7bc405d713 update the readme hash in sharness 2015-02-23 13:47:19 -08:00
Jeromy
6241c25984 make contructor code a little less magical 2015-02-18 19:11:33 +00:00
Brian Tiger Chow
bbc07b6bcc fix(config) rename variable GCR -> SNR 2015-02-15 06:29:15 -08:00
Brian Tiger Chow
bbcd89fbf2 fix(test/snr_client) use config.DefaultSNRServers 2015-02-15 06:26:47 -08:00
Brian Tiger Chow
aed1373a01 change log level 2015-02-15 04:41:19 -08:00
Brian Tiger Chow
87c6604b56 misc: add test for api readiness 2015-02-15 04:41:18 -08:00
Brian Tiger Chow
31587b2d0a debug: add gc-client TODO rm before merge
add automatic add and cat for debugging purposes

retry cats

cast string

argh! @whyrusleepgin

use mock repo to avoid clashing

larger files for more variety FIXUP into gc-client

fix: change in both places FIXUP gc-client

 fix(gc-client) start with size 1 (unit)

fix(gc-client) start at 1 FIXUP prev

gc-client rm comment

gc-client larger files

fix(gc-client) cat the data out to dev null to ensure entire file is fetched

perf(gc-client) use io.Pipe to handle io transfer

fixup
2015-02-15 04:41:17 -08:00
Brian Tiger Chow
2298cf66cf test GetPutRecord
validate doesn't work. the peer's public key is not present in the
peerstore.
2015-02-15 04:41:16 -08:00
Brian Tiger Chow
19eb35137b refactor(routing) rename grandcentral to supernode
thanks @mappum

remove .go-ipfs
2015-02-15 04:41:10 -08:00
Brian Tiger Chow
b34fee4ede test(gc) with 10 node integration test 2015-02-14 14:13:54 -08:00
Brian Tiger Chow
f17ede8334 refactor(integrationtest) use RoutingOptions in mocknet repo 2015-02-14 14:13:54 -08:00
Christian Couder
391b5a3c89 t0040: use multihash instead of shasum in tests
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-08 13:36:37 +01:00
Christian Couder
fe1ba2bf18 test: use multihash instead of shasum in tests
As shasum is not installed on all machines and
we use multihash anyway in the code base, it
removes one dependency to use shasum instead of
shasum in the tests.

Now that there are sharness tests in multihash
it is also safe to use it.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-08 13:35:45 +01:00
Juan Batiz-Benet
0de13b071d Merge pull request #743 from jbenet/misc-2-2
Gateway Changes
2015-02-05 00:05:43 -08:00
Matt Bell
09e4224aa7 test/sharness: Fixed gateway tests 2015-02-04 18:46:59 -08:00
Christian Couder
bbb6196d12 Delete test/bin/fsh
It has been replaced with test_fsh().

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-04 22:01:03 +01:00
Christian Couder
fa13afa5ca Replace fsh with test_fsh in sharness tests
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-04 21:53:19 +01:00
Christian Couder
65cbbdff84 Add ipfs-test-lib.sh and source it in sharness test-lib.sh
The new ipfs-test-lib.sh file contains generic test
functions.
We also start replacing fsh with a shell function named
test_fsh() in ipfs-test-lib.sh.
And we move our custom test_cmp in ipfs-test-lib.sh.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-04 21:50:07 +01:00
Juan Batiz-Benet
756382a6c3 sharness/test-lib: wait longer for daemon
it keeps failing early.
2015-02-02 21:05:32 -08:00
Christian Couder
752f54e313 sharness/test-lib: remove some "cat" followed by |
The pattern "cat FILE | COMMAND" can be simplified
to just "COMMAND FILE" when COMMAND accepts files as
arguments.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-03 04:46:35 +01:00
Matt Bell
48885377fc test/sharness: rm quotes 2015-02-02 10:13:46 -08:00
Matt Bell
54fef5ea96 test/sharness: Added tests for 'ipfs add -w' 2015-02-02 10:07:36 -08:00
Brian Tiger Chow
07529fa56a run profiler in test 2015-02-02 01:31:51 -08:00
Brian Tiger Chow
4af79b7135 clean old docker images 2015-02-02 01:31:51 -08:00
Brian Tiger Chow
093c87ef45 feat: keep profiling data from test runs 2015-02-02 01:31:51 -08:00
Brian Tiger Chow
c2664288be fix(integrationtest) let amount of information match test name 2015-02-01 21:54:21 -08:00
Brian Tiger Chow
f9de5fb106 fix test name 2015-02-01 21:54:21 -08:00
Brian Tiger Chow
a9573058f5 refac(integrationtest) remove core.ConfigOption cast in tests 2015-02-01 21:54:20 -08:00
Brian Tiger Chow
41d6d040b8 misc(integrationtest) bump 3-legged cat to 100 MB 2015-02-01 21:54:19 -08:00
Juan Batiz-Benet
b2da275475 sharness/lib: fix daemon startup check
Go back to test_run_repeat_10_sec to make sure the API
is there. I think this is also clearer on the reader.
2015-02-01 21:23:31 -08:00
Christian Couder
ce10f20ca7 test/sharness: improve t0111 using test_cmp
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-01 20:46:28 -08:00
Juan Batiz-Benet
1d9d13e286 Merge pull request #720 from jbenet/fix-sharness-gateway-addr-check
sharness/lib: fixing gateway addr check
2015-02-01 20:45:58 -08:00
Juan Batiz-Benet
7ce3c79519 sharness/lib: fixing gateway addr check
seems that the previous way isnt liked by all platforms
2015-02-01 20:41:34 -08:00
Christian Couder
5aeadd44ad test/sharness: improve t0090 by using printf
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-01 20:25:24 -08:00
Juan Batiz-Benet
5b0a544b92 sharness/t0090-get.sh disable the failing tar test 2015-02-01 20:16:56 -08:00
Juan Batiz-Benet
33144f4e39 sharness/t0021-config.sh test config setting 2015-02-01 20:15:51 -08:00
Juan Batiz-Benet
24f0d020e0 sharness: better config setting 2015-02-01 20:15:50 -08:00
Juan Batiz-Benet
56b6a2069a sharness: gateway fixes
there's an odd error setting the config.
2015-02-01 19:24:36 -08:00
Christian Couder
83e88a8e2b test/sharness: improve t0080
The following changes are made to make t0080
cleaner, safer and more canonical:

- remove useless stuff,
- don't use a pipe after ipfs commands,
- use test_must_fail before ipfs commands instead of !

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-02 01:24:33 +01:00
Juan Batiz-Benet
d0dd22b7d4 sharness/t0120-bootstrap: test the bootstrap cmd
and do it both online + offline
2015-02-01 06:07:28 -08:00
Juan Batiz-Benet
de464b7e40 test/3nodetest: list bootstrap nodes to debug 2015-02-01 05:16:53 -08:00
Juan Batiz-Benet
29bf59dded bootstrap: use ipfsaddr for boostrap peers ⚠️
⚠️ this commit makes your current configs unusable, as the
default bootstrap peers. You may need to edit your config.

Go from:

```js
Bootstrap: [
  {
    "Address": "/ip4/104.131.131.82/tcp/4001",
    "PeerID": "QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
  }
]
```

To:
```js
Bootstrap: [
  "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
]
```
2015-02-01 05:16:52 -08:00
Juan Batiz-Benet
c372255807 daemon: fix output + time waiting 2015-02-01 04:29:32 -08:00
Juan Batiz-Benet
8ce304014c require curl 2015-02-01 00:10:48 -08:00
Juan Batiz-Benet
1dbe39b678 sharness/t0111-gateway-writable: removed fd redirect
Not sure why this fd redirect was here. Is it necessary?
Tests seem to pass for me.

cc @mildred
2015-01-31 22:55:06 -08:00
Juan Batiz-Benet
12cf6a8426 sharness: note re API/Gateway in t0110-gateway 2015-01-31 22:55:05 -08:00
Juan Batiz-Benet
052c867a70 sharness: output options in verbose mode 2015-01-31 22:55:05 -08:00
Juan Batiz-Benet
f1d34a2a85 test/sharness: fix errors
- core: daemon stdout print to cmd + daemon init checks
- core: fixed bug where the gateway was printed as "API"
- sharness/test-lib: daemon init checks
- sharness/test-lib: portable TCP port check
- sharness/init: fix test bits output
- sharness: use common hashes in one place.
- move t0100-http-gateway -> t0111-gateway-writable
- sharness: test-lib funcs for gateway config
- sharness/t0111-gateway-writable: use sh funcs
- sharness/t0111-gateway-writable: fixes
  - escape all vars (always `cmd "$VAR"` never `cmd $VAR`)
  - use $FILEPATH, not $path
  - last test seems to fail
2015-01-31 22:54:34 -08:00
Mildred Ki'Lya
51af53d8f7 Added Sharness test for HTTP Gateway 2015-01-31 23:36:46 +01:00
Juan Batiz-Benet
3f4d38feca sharness: correctness. must have &&
cc @whyrusleeping
2015-01-31 07:52:47 -08:00
Juan Batiz-Benet
73234479fa init docs: go generated welcome dir + files
updated sharness hashes
2015-01-31 07:51:30 -08:00
Jeromy
9ddfafb40a address concerns about user interface with new Path type 2015-01-30 19:55:38 +00:00
Brian Tiger Chow
f1333d6419 bench: offline add 2015-01-30 06:57:42 -08:00
Brian Tiger Chow
fadedab003 rename epictest -> integrationtest 2015-01-29 22:22:25 -08:00
Jeromy
abb3c9c9c4 implement path type 2015-01-29 17:51:08 +00:00
Juan Batiz-Benet
14eceee35e epictest: fix three-legged-cat
http://gateway.ipfs.io/ipfs/QmfUFkQuqjfQzLNhMLwiibiAxnAaZEJAbYkey9orXJ4aQe/3lcat.jpg
2015-01-29 01:10:01 -08:00
Juan Batiz-Benet
958cc61647 epictest: added test for bitswap wo routing 2015-01-28 23:55:30 -08:00
Juan Batiz-Benet
8ed1b14034 sharness: rename conflicting test 2015-01-28 17:02:04 -08:00
Matt Bell
21575ba535 test/sharness: Fixed gateway test formatting 2015-01-28 16:52:46 -08:00
Matt Bell
2028d37076 test/sharness: Added basic gateway tests 2015-01-28 16:46:00 -08:00
Jeromy
72a5902e12 address concerns from PR 2015-01-28 19:36:30 +00:00
Jeromy
f1267d0624 change ipns resolve/publish to store raw keys, not b58 encoded 2015-01-28 19:36:30 +00:00
Juan Batiz-Benet
cbe07776e3 test/sharness: make sure to output vars in quotes
cc @whyrusleeping: you werent doing so
cc @mappum: you were trying to escape them, but
   were un-escaping them in cases with longer quotes.
2015-01-28 01:04:06 -08:00
Juan Batiz-Benet
ed16840414 test/sharness: "echo -n" bug
In OSX, the `echo -n` was _somehow_ printing "-n" out... not
really sure why, as the bsd `echo` program supports -n. I changed
this to printf -- which is safer.
2015-01-28 00:53:41 -08:00
Juan Batiz-Benet
72f703642a test/sharness: style fix
Let's use `>file`, not `> file`, as it makes it easier to parse.
2015-01-28 00:49:50 -08:00
Juan Batiz-Benet
c283c0a690 test/sharness: allow testing of daemon without FUSE
This commit allows sharness tests to run daemon tests when the FUSE
option is off. Unsure why this was previously included.
2015-01-28 00:36:30 -08:00
Brian Tiger Chow
bbcc259eaf fix(sharness): Initializing daemon... output 2015-01-27 17:04:38 -08:00
Juan Batiz-Benet
1eb0bfe834 Merge pull request #668 from jbenet/hack
misc user-friendliness fixes
2015-01-26 19:00:09 -08:00
Juan Batiz-Benet
76d9d89aff user friendliness in logs + output 2015-01-26 17:01:00 -08:00
Matt Bell
45ed27e273 test/sharness: get: Quote variables 2015-01-26 17:00:40 -08:00
Matt Bell
23f810e187 test/sharness: Fixed get gzip archive test 2015-01-24 21:40:19 -08:00
Juan Batiz-Benet
e2db6418ae get: disable failing tests
@mappum these tests are failing (1 on osx and 1 on travis).
May be related to the versions of tar? not sure.
2015-01-24 10:22:43 -08:00
Juan Batiz-Benet
aac98914a5 Merge pull request #596 from chriscool/add_dependencies_test
Add "test/dependencies" dir and "godep restore" test
2015-01-24 09:42:39 -08:00
Matt Bell
76534bd279 test/sharness: Added tests for get 2015-01-24 07:19:39 -08:00
Matt Bell
4ee3d39253 cmd/ipfs: Added key size to 'ipfs init' output 2015-01-23 19:14:59 -08:00
Christian Couder
31d07f0f7b Add "test/dependencies" dir and "godep restore" test
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-01-23 21:27:45 +01:00
Juan Batiz-Benet
95d58b2a4a core: cleaned up bootstrap process 2015-01-23 05:25:31 -08:00
Jeromy
eb6afd3edc fix interface for coreunix.Cat, now takes a path 2015-01-23 06:39:20 +00:00
Brian Tiger Chow
df9e6ce640 refactor: rename IPFS_DIR -> IPFS_PATH
closes #394 https://github.com/jbenet/go-ipfs/issues/394
2015-01-21 17:09:39 -08:00
Juan Batiz-Benet
f6111d82fe Merge pull request #558 from jbenet/feat/gc
initial implementation of repo-gc command
2015-01-21 16:48:28 -08:00
Jeromy
1244fd251d update tests, and ensure 'default' blocks are pinned 2015-01-22 00:16:30 +00:00
Jeromy
8e7d984751 updates from PR, tests tests tests! 2015-01-21 08:55:50 +00:00
Brian Tiger Chow
2149f8f446 cleanup 2015-01-20 23:43:21 -08:00
Brian Tiger Chow
ac64c2c9e7 extra args to benchmark Makefile 2015-01-20 23:43:20 -08:00
Jeromy
4de881a185 move GC code into core/repo, and add sharness test 2015-01-21 04:28:02 +00:00
Jeromy
9adcfe7bc2 address concerns from PR 2015-01-21 04:28:02 +00:00
Jeromy
ccb36277dd fix pinning UX, and add tests to match 2015-01-21 04:28:01 +00:00
Jeromy
5b20e86ed4 sharness test for pinning changes 2015-01-21 04:28:01 +00:00
Brian Tiger Chow
a58515ffb2 add benchmark for ipfs add CLI 2015-01-20 17:01:09 -08:00
Brian Tiger Chow
6b8d3e3c69 use extracted unit package 2015-01-20 17:01:09 -08:00
Brian Tiger Chow
b0596cd4ff rename coreio to coreunix 2015-01-18 14:41:43 -08:00
Brian Tiger Chow
a025fc9adf refactor(core) switch style to type assertions
@jbenet cool with this?
2015-01-18 14:41:43 -08:00
Brian Tiger Chow
4b5ff960c9 feat(core): use repo.Repo in core constructor 2015-01-18 14:41:42 -08:00
Brian Tiger Chow
884143bf9c move generic packages to thirdparty (see thirdparty/README.md) 2015-01-18 14:04:45 -08:00
Brian Tiger Chow
631d2154f2 fix(fsrepo): use "please run ipfs init" message 2015-01-13 03:09:32 -08:00
Brian Tiger Chow
196bc04541 test(bootstrap, config): ensure user-provided keys are protected 2015-01-13 03:09:32 -08:00
Brian Tiger Chow
53f201cea9 fix(test/sharness/Makefile): remove ipfs binary when cleaning 2015-01-13 03:09:31 -08:00
Juan Batiz-Benet
ed41ac27fd daemon: refactor common parts of serve funcs 2015-01-12 01:01:21 -08:00
Brian Tiger Chow
223ee4df1a refactor(core): move Add, Cat to core/io 2015-01-11 01:23:27 -08:00
Brian Tiger Chow
707874c3a5 refactor(core): init node.Blocks in shared NewIPFSNode constructor 2015-01-11 01:23:26 -08:00
Brian Tiger Chow
34e8f3ee26 refactor(core): init DAG and its dependents in shared constructor
fix: remove merkledag import

may need to squash this commit into the merkledag move commit
2015-01-11 01:23:26 -08:00
Brian Tiger Chow
91808e18f7 refactor: use core.ConfigOption return type 2015-01-11 01:23:26 -08:00
Brian Tiger Chow
7cebb33e81 fix: remove dead code 2015-01-11 01:23:26 -08:00
Brian Tiger Chow
5c46597c53 use the core.NewIPFSNode constructor
NB: all commits (from master) pass tests up to this point.

fix: squashme into use core constructor
2015-01-11 01:23:26 -08:00
Brian Tiger Chow
401b8f413d misc: move initialization sqaush 2015-01-11 01:23:26 -08:00
Brian Tiger Chow
efb75ee5ba refactor: move add and cat to the core 2015-01-11 01:23:25 -08:00
Brian Tiger Chow
85401d53fd refactor: use the Core in the integration test 2015-01-11 01:23:25 -08:00
Brian Tiger Chow
007ffd40bd refactor: move LatencyConfig 2015-01-11 01:23:25 -08:00
Juan Batiz-Benet
136ef70f00 calc_test for picking link block size 2015-01-10 01:22:45 -08:00
Juan Batiz-Benet
05a0a944ce makefile: fix target in sharness tests 2015-01-10 01:07:43 -08:00
Christian Couder
9e8fc3826a install-sharness.sh: use git instead of wget and shasum
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-01-09 23:13:48 +01:00
Juan Batiz-Benet
2faafa8478 test/Makefile 2015-01-07 07:57:22 -08:00
Juan Batiz-Benet
28cf220de1 dockertest -> test/3nodetest 2015-01-07 07:57:22 -08:00
Juan Batiz-Benet
b479602b61 moved epictest -> test/epictest 2015-01-07 07:24:21 -08:00
Juan Batiz-Benet
cecfa45745 moved sharness tests to a subdir.
kept bin in place
2015-01-07 07:10:17 -08:00
Juan Batiz-Benet
07b923d7a4 ipfs block stat cmd 2015-01-07 00:55:27 -08:00
Juan Batiz-Benet
0395a7af1e ipfs add output not sorted, cmds files sorted
I made the commands lib dir listing sort the contents
so we get the same sequence of files from it repeatably.
2015-01-06 14:02:49 -08:00
Christian Couder
3b65f1a507 Add sharness tests for recursive add
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-01-06 13:12:23 -08:00
Jeromy
e3cf893616 implement recursive indirect blocks
improve efficiency of multilayered indirect blocks

clean up tests

panic cleanup

clean up logic, improve readability

add final root node to the dagservice upon creation

importer: simplified dag generation

test: updated hashes using latest code

@whyrusleeping this is why the sharness tests
were failing: the hashes are added manually to
make sure our generation doesn't change.

cleanup after CR

fix merkledag tests

fix small block generation (no subblocks!)
2015-01-06 19:43:56 +00:00
Juan Batiz-Benet
0ba6bca130 sharness tests: added note re: daemon init 2015-01-05 08:08:56 -08:00
Juan Batiz-Benet
e785ad1d64 sharness: make sure not mounted
if a test is cancelled, unmount may not run. then, must
run umount before mounting, just to make sure.
2015-01-05 08:04:52 -08:00
Juan Batiz-Benet
b372b4879e sharness: init: bootstrap rm -all
sharness tests should not bootstrap to the dht. it
may be useful to test that specifically, but not on
the other tests.
2015-01-05 08:00:16 -08:00
Brian Tiger Chow
a8127a28e1 fix: force clean test results directory
Without `-f`, `make clean` fails on machines that don't have the dir.

cc @jbenet
2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
c47b808d77 sharness/init: fixed ipfs init output 2015-01-05 00:09:49 -08:00
Jeromy
b241c8048f fix sharness test for ipfs init output 2015-01-05 00:02:56 -08:00
Juan Batiz-Benet
e407c2ef83 sharness: override test_cmp for verbose 2015-01-04 22:53:21 -08:00
Juan Batiz-Benet
481c19ac23 sharness: note in makefile describing TEST_VERBOSE 2015-01-04 22:30:59 -08:00
Juan Batiz-Benet
e5f24dc26b sharness: expanded on readme 2015-01-04 22:22:45 -08:00
Juan Batiz-Benet
be4191d800 sharness: nice verbose ouput
Make sharness tests' output helpful when verbose.
This means cating certain files, or running diagnostic
commands. I used a construction like:

    test_expect_success ".go-ipfs/ has been created" '
      test -d ".go-ipfs" &&
      test -f ".go-ipfs/config" &&
      test -d ".go-ipfs/datastore" ||
      fsh ls -al .go-ipfs
    '

The `|| ...` is a diagnostic run when the preceding command
fails. `fsh` is a trivial script that echoes the args, runs
the cmd, and then also fails, making sure the test case fails.
(wouldnt want the diagnostic accidentally returning true and
making it _seem_ like the test case succeeded).
2015-01-04 22:22:33 -08:00
Juan Batiz-Benet
d06e7e342d sharness: set verbosity from env 2015-01-04 20:39:23 -08:00
Juan Batiz-Benet
a9da519715 test/countineyn terminal and error code 2014-12-09 02:24:11 -08:00
Juan Batiz-Benet
b0e251bda1 Makefile: add test_all_commits 2014-12-08 20:39:00 -08:00
Christian Couder
aca62a420a Add sharness test for ipfs add --quiet
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-30 14:32:08 +01:00
Christian Couder
5e133a136c Add sharness tests for ipfs add and cat
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-23 21:02:39 +01:00
Christian Couder
196651d5f5 Add sharness mount tests with a 5 MB file
These new tests are not marked EXPENSIVE as they
should be fast enough even on Travis CI.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-20 20:46:02 +01:00
Christian Couder
c8e7a95644 Add an EXPENSIVE prereq and use it in t0040
We add this prereq to tests with a 100MB file
as they are slow on Travis CI.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-20 20:27:09 +01:00
Christian Couder
f06b9ca126 Rename test_launch_ipfs_mount into test_launch_ipfs_daemon_and_mount
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-20 20:11:03 +01:00
Christian Couder
1e077828cb Rename test_kill_ipfs_mount into test_kill_ipfs_daemon
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-20 20:03:41 +01:00
Christian Couder
882aac223e Add issue number to expected failures in sharness tests
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-19 21:21:03 +01:00
Christian Couder
2e566a7de3 Add sharness tests to document existing mount bugs
This uses test_expect_failure to document some bugs
related to 'ipfs mount'.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-18 22:44:28 +01:00
Juan Batiz-Benet
d124a6719e skip for now 2014-11-18 08:50:08 -08:00
Juan Batiz-Benet
d1ab80224d test: hack around travis being slow
this is a hack around travis key-gen being really slow.
One option would be to add the --key-bits option to daemon
as well. Another option would be to find a better way to
wait for the output, rather than waiting n seconds.

cc @chriscool thoughts?
2014-11-18 08:33:47 -08:00
Juan Batiz-Benet
3e96f4810b test: added daemon --init test 2014-11-18 08:19:25 -08:00
Juan Batiz-Benet
a7d1fd42d8 updating daemon addr output 2014-11-18 08:19:25 -08:00
Juan Batiz-Benet
e24b09f82d test: comment out extra output in add_and_cat 2014-11-18 06:21:07 -08:00
Juan Batiz-Benet
bd962b6c32 test: lower key size for mount tests 2014-11-18 06:18:32 -08:00
Juan Batiz-Benet
607e4d3e52 sharness tests back to cmd/ipfs 2014-11-18 06:14:59 -08:00
Juan Batiz-Benet
088016c850 test: cat test actual output 2014-11-17 22:36:19 -08:00
Juan Batiz-Benet
493e5d3b3e test: test init output 2014-11-17 22:36:19 -08:00
Christian Couder
220e108ddd Adapt mount tests to ipfs2 changes
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-16 03:20:11 -08:00
Christian Couder
b140c33839 Adapt t0010 to output from ipfs2
The ouput from "ipfs help" changed in ipfs2.
With the change in this commit, this output change doesn't
prevent the test to pass.

Test t0010 now passes on my Linux machine.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-16 03:20:11 -08:00
Christian Couder
68f7b50b5c Adapt t0050 to output from ipfs2
The ouput from "ipfs block" changed in ipfs2.
With the change in this commit, this output change doesn't
prevent the test to pass.

Test t0050 now passes on my Linux machine.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-16 03:20:10 -08:00
Christian Couder
30f28c00ce Adapt t0040 to output from ipfs2
The ouput from "ipfs add" changed in ipfs2.
With the changes in this commit, this output change doesn't
prevent the test to pass.

With TEST_NO_FUSE=1 test t0040 now passes on my Linux machine.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-16 03:20:10 -08:00
Brian Tiger Chow
4678dea045 tests(sharness) attempt to execute sharness tests on ipfs2
@jbenet @chriscool

(not to be merged into master) This is a hack to run sharness tests on
th ipfs2 binary. Instead of compiling cmd/ipfs, it compiles cmd/ipfs2
and copies this into test/bin/ipfs.

I thought this would be enough to pass the `basic-commands` test, but
it's not.

Although the output is fairly similar, the `ipfs version` test fails.

```
test (feat/test2) λ. diff version1 version2
1c1
< ipfs version 0.1.7
---
> ipfs version 0.1.5
```

I'm not very experienced with `sh` scripting, so perhaps I'm missing a
key ingredient or maybe misunderstanding the the tests are meant to
work.

Would like to get input on this.

Thanks, @maybebtc
2014-11-16 03:20:10 -08:00
Christian Couder
4a2cb9605c Update hashes in test/t0040-add-and-cat.sh
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-15 02:10:52 -08:00
Christian Couder
5dd17014fa Update test/README.md about sharness directory
Now sharness is in "lib/sharness"
2014-11-09 19:16:02 +01:00
Christian Couder
fc1a35e35a Add test script for block command
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-09 18:00:25 +01:00
Juan Batiz-Benet
1e434ef3c4 vendor: updated random + fixed test import
There is a dummy test import: test/lib/random-dep.go
Because godep doen't yet vendor binaries nicely.
2014-11-08 20:12:02 -08:00
Juan Batiz-Benet
4bf3e967d8 test/t0040-add-and-cat updated hashes (new random) 2014-11-08 20:12:02 -08:00
Juan Batiz-Benet
842de46ccf test: moved installed things into own dirs
I moved installed things into own dirs bin and lib.

@chriscool sorry to move things around again, the top level
test dir was getting a bit clutterd.
2014-11-08 20:12:02 -08:00
Juan Batiz-Benet
5680c112ef test: install random from vendored code 2014-11-08 18:49:28 -08:00
Juan Batiz-Benet
49f30b1597 added random to godeps 2014-11-08 18:49:01 -08:00
Christian Couder
e211b6543a Add a README.md to explain a few things 2014-11-08 02:44:03 +01:00
Christian Couder
2b5f1b2d8c Install sharness in a 'sharness' directory
It is cleaner if sharness is installed in its own
directory.
2014-11-08 02:44:03 +01:00
Juan Batiz-Benet
04efbb9a55 test: install random locally for travis. 2014-11-07 17:24:13 -08:00
Juan Batiz-Benet
c9ffe1a281 tests: use ipfs but with the right tool
Addresses comments in: 7e14f1737d
2014-11-07 16:24:44 -08:00
Juan Batiz-Benet
7ab38696f6 travis: fix install random error 2014-11-07 15:24:31 -08:00
Juan Batiz-Benet
7e14f1737d test/: build own ipfs tool to test
The tests were using the globally installed ipfs.
This commit changes it to build + use its own ipfs binary.
2014-11-07 15:16:29 -08:00
Juan Batiz-Benet
37279d55ca install go-random 2014-11-07 14:54:58 -08:00
Christian Couder
7e46d95145 Use a FUSE prerequisite to skip mount tests
When there is no fuse we should skip all mount
tests and using a FUSE prerequisite is a good
way to do that.
2014-11-07 14:54:58 -08:00
Juan Batiz-Benet
fc6213db09 dont test mount when no fuse 2014-11-07 14:53:55 -08:00
Juan Batiz-Benet
eee15baeb6 remove test-sharness-config 2014-11-07 14:53:55 -08:00
Juan Batiz-Benet
54651618e8 install aggregate-results.sh too 2014-11-07 14:53:55 -08:00
Juan Batiz-Benet
9535cb5802 install sharness 2014-11-07 14:53:55 -08:00
Juan Batiz-Benet
9434f6e531 tests: use shasum instead of sha1sum
sha1sum is not in osx by default.
shasum seems to be everywhere.
2014-11-07 14:13:12 -08:00
Christian Couder
22ac599703 test ipfs cat and ipfs add with a 100MB file
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-06 23:00:45 +01:00
Christian Couder
630816c7ee Speed up checking if mount works
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-01 15:29:27 +01:00
Christian Couder
4e2763a40a Refactor mount related tests
This adds test_launch_ipfs_mount() and test_kill_ipfs_mount()
to avoid duplicating tests to launch "ipfs mount" and to
kill it.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-01 10:52:09 +01:00
Christian Couder
e3da26d116 Add test script for add and cat commands
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-10-31 22:19:19 +01:00
Christian Couder
223d5c3001 Add trash directories into test/.gitignore
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-10-31 21:44:07 +01:00
Christian Couder
b6a98c10b3 Add test for ipfs mount
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-10-31 21:25:35 +01:00
Christian Couder
8357c7b13d Add test script for ipfs init
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-10-26 10:10:22 +01:00
Christian Couder
07bd18b53d Display which Makefile target is launched
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-10-26 10:10:22 +01:00
Christian Couder
47e7583464 Add test/.gitignore to ignore test-results/
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-10-25 22:25:18 +02:00
Christian Couder
aeb019f2b8 Add test/Makefile to run the test scripts
You can use it like this to launch all the
test scripts in order:

$ cd test
$ make
 rm -r test-results
 *** t0010-basic-commands.sh ***
 ok 1 - current dir is writable
 ok 2 - ipfs version succeeds
 ok 3 - ipfs version output looks good
 ok 4 - ipfs help succeeds
 ok 5 - ipfs help output looks good
 # passed all 5 test(s)
 1..5
 ./test-aggregate-results.sh
 fixed   0
 success 5
 failed  0
 broken  0
 total   5

Or you can just run one test like this:

$ make t0010-basic-commands.sh
 *** t0010-basic-commands.sh ***
 ok 1 - current dir is writable
 ok 2 - ipfs version succeeds
 ok 3 - ipfs version output looks good
 ok 4 - ipfs help succeeds
 ok 5 - ipfs help output looks good
 # passed all 5 test(s)
 1..5
2014-10-25 14:12:27 +02:00
Christian Couder
0aebe75361 Add test-aggregate-results.sh
This script aggregates test results using Sharness.
2014-10-25 14:12:20 +02:00
Christian Couder
1fb4192642 Move Sharness config checks into test-sharness-config.sh
This way we can easily reuse the checks in
test-sharness-config.sh.
2014-10-25 13:58:54 +02:00
Christian Couder
12490cb477 Add t0010-basic-commands.sh
This checks a little bit the installation and some
basic commands.

You can run it like that:

$ cd test
$ ./t0010-basic-commands.sh
 ok 1 - current dir is writable
 ok 2 - ipfs version succeeds
 ok 3 - ipfs version output looks good
 ok 4 - ipfs help succeeds
 ok 5 - ipfs help output looks good
 # passed all 5 test(s)
 1..5
2014-10-25 13:57:19 +02:00
Christian Couder
449523eebd Add test-lib.sh for our shell test framework
Our test framework is based on Sharness.
So the first thing to do is to source it.
2014-10-25 13:53:57 +02:00