Commit Graph

1591 Commits

Author SHA1 Message Date
Jeromy
5a0b6e593a small sharness test for promise failure checking
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-04-12 11:21:34 -07:00
Jeromy
bdc5456d52 update libp2p dep to fix hanging listeners problem
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-04-11 12:52:54 -07:00
Jeromy
e9edd2d884 use nc -w instead of -q because osx is slow
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-04-07 15:55:41 -07:00
Jeromy
42455d27b3 multistream tests use data from file
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-04-07 15:55:41 -07:00
Jeromy
3148f4c34f fix tests that check swarm port knocking
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-04-07 15:55:41 -07:00
Jeromy
8f3a51ac42 switch to new libp2p with mss crypto
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-04-07 15:55:41 -07:00
Jeromy
e661832575 hide fd adjusting code behind daemon feature flag
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-04-07 07:41:09 -07:00
Lars Gierth
09937f84b6 gateway: enforce allowlist for path prefixes
The gateway accepts an X-Ipfs-Path-Prefix header,
and assumes that it is mounted in a reverse proxy
like nginx, at this path. Links in directory listings,
as well as trailing-slash redirects need to be rewritten
with that prefix in mind.

We don't want a potential attacker to be able to
pass in arbitrary path prefixes, which would end up
in redirects and directory listings, which is why
every prefix has to be explicitly allowed in the config.

Previously, we'd accept *any* X-Ipfs-Path-Prefix header.

Example:

We mount blog.ipfs.io (a dnslink page) at ipfs.io/blog.

nginx_ipfs.conf:

    location /blog/ {
        rewrite "^/blog(/.*)$" $1 break;
        proxy_set_header Host blog.ipfs.io;
        proxy_set_header X-Ipfs-Gateway-Prefix /blog;
        proxy_pass http://127.0.0.1:8080;
    }

.ipfs/config:

    "Gateway": {
        "PathPrefixes": ["/blog"],
        // ...
    },

dnslink:

    > dig TXT _dnslink.blog.ipfs.io
    dnslink=/ipfs/QmWcBjXPAEdhXDATV4ghUpkAonNBbiyFx1VmmHcQe9HEGd

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-04-04 16:31:57 -04:00
Christian Couder
908fb95bb1 sharness/Makefile: clean all BINS when cleaning
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-04-03 13:02:04 +02:00
Steven Allen
a72d26b875 api: correctly set the content type for object get --encoding=protobuf
It used to default to `application/json` but is now correctly set to
`application/protobuf`.

fixes #2469

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2016-03-31 17:14:41 -04:00
Jeromy
9f75ac4d75 update utp and cleanup more godeps along the way
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-03-29 19:18:14 -07:00
Jeromy
e9b1fe4cef clean up dependencies
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-03-23 11:54:26 -07:00
Jeromy Johnson
573b191df2 Merge pull request #2465 from ipfs/fix/double-encoding-header
fix double transfer encoding header problem
2016-03-15 10:22:14 -07:00
Jeromy Johnson
655804c5ef fix whitespace trimming
License: MIT
Signed-off-by: Jeromy Johnson <why@ipfs.io>
2016-03-14 16:36:31 -07:00
Jeromy Johnson
850602361d fix double transfer encoding head problem
License: MIT
Signed-off-by: Jeromy Johnson <why@ipfs.io>
2016-03-14 16:26:49 -07:00
Jeromy Johnson
102a6dde22 Merge pull request #2451 from ipfs/t0300-improve-debug-message
t0300: improve docker_build debug message
2016-03-14 16:15:59 -07:00
Jeromy Johnson
286a5968c5 Merge pull request #2430 from diasdavid/feat/repo-stat
Feature: `ipfs repo stat`
2016-03-11 12:51:11 -08:00
Jeromy
97d583dd8f update libp2p dep
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-03-09 09:53:19 -08:00
Jeromy
d8be357087 add new test to show problem
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-03-09 09:50:00 -08:00
Christian Couder
94083ae624 t0300: improve docker_build debug message
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-03-07 10:35:52 +01:00
David Dias
c10e329b78 repo-stat
License: MIT
Signed-off-by: David Dias <daviddias.p@gmail.com>
2016-03-04 23:45:03 +00:00
Jeromy
7072dab396 grab daemon pid into its own variable
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-03-03 22:47:50 -08:00
Jeromy
63a9ed202c make t0060 use port zero
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-03-02 15:00:04 -08:00
Stephen Whitmore
f4367f6831 t0031: ensure iptb init happens
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-02-29 16:05:48 -08:00
Stephen Whitmore
b66e089ec1 trailing whitespace
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-02-29 16:05:48 -08:00
Stephen Whitmore
b4bd604426 uses iptb exclusively for mount-publish test
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-02-29 16:05:48 -08:00
Stephen Whitmore
0afbd1857f Prevents 'ipfs name publish' when /ipns is mounted.
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-02-29 16:05:48 -08:00
Jeromy Johnson
922ad3cde5 Merge pull request #2392 from ipfs/std-err-msg-prereq
sharness: replace POSIX prereq with STD_ERR_MSG
2016-02-29 15:11:17 -08:00
Jeromy Johnson
dede20eab4 Merge pull request #2384 from ipfs/feat/dag-refactor
refactor merkledag fetching methods
2016-02-29 10:04:34 -08:00
Stephen Whitmore
2f64de0d61 Uses preset API_MADDR and GWAY_ADDR globals.
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-02-23 13:22:58 -08:00
Stephen Whitmore
c342d57347 Updates uses of *_ADDR -> *_MADDR
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-02-23 13:22:58 -08:00
Stephen Whitmore
31f4ef02c2 Use test_launch_ipfs_daemon
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-02-23 13:22:58 -08:00
Stephen Whitmore
597d684160 Adds arbitrary port support to t0060-daemon.sh.
Removes all of the hardcoded ports and defaults to non-standard API,
Gateway, and Swarm ports.

License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-02-23 13:22:58 -08:00
Jeromy Johnson
f630f9d92a Merge pull request #2382 from ipfs/fix/mfs-truncate
fix minor mfs truncate bug
2016-02-23 10:42:06 -08:00
Christian Couder
00e03404d8 sharness: replace POSIX prereq with STD_ERR_MSG
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-22 22:13:30 +01:00
Christian Couder
73e76dca56 files: make 'files ls' defaults to /
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-22 19:15:49 +01:00
Jeromy
d2931d70a6 fix test now that dag batches can more properly fail
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-20 16:21:04 -08:00
Jeromy
973707a884 fix minor mfs truncate bug
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-19 18:57:41 -08:00
Jeromy Johnson
662625318a Merge pull request #2374 from ipfs/t0062-indentation-fix
t0062: fix indentation
2016-02-19 08:42:08 -08:00
Christian Couder
c6a7b51f0c t0062: fix indentation
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-19 04:24:12 +01:00
Christian Couder
ad71b15e36 sharness: remove xt0130-multinode.sh
xt0130 test is already in as t0130.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-19 03:32:07 +01:00
Christian Couder
fa57fb7349 sharness: remove x0045-add-cat-iptb.sh
x0045 can be removed since we do the same stuff in other tests.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-19 03:31:39 +01:00
Jeromy
11f9e7f647 add a pause to fix timing on t0065
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-15 19:16:03 -08:00
Jeromy Johnson
6b76e2a41a Merge pull request #2319 from ipfs/cleanup/gx-godeps
use gx vendored packages instead of godeps ones
2016-02-13 14:46:19 -08:00
Jeromy
d7dab3afea Use gx vendored go-ipfs-utils where possible
For the rest of the packages in util, move them to thirdparty
and update the references. util is gone!

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-12 17:21:40 -08:00
Christian Couder
ce5eac46d4 t0020: improve error message
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-12 17:20:23 -08:00
Christian Couder
7d80512a4c test-lib: add test_path_cmp()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-12 17:20:23 -08:00
Christian Couder
ea8d8aaa13 appveyor: use a POSIX prereq
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-12 17:20:23 -08:00
Jeromy
0c7595b65b Use port zero for all ipfs daemon addresses in sharness testing
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-12 14:04:32 -08:00
Jeromy Johnson
c913105dd7 Merge pull request #2308 from ipfs/docker-auto-builds
Docker automatic builds
2016-02-10 09:23:23 -08:00
Jeromy
5474e15e93 blockstore locks return unlocker object now
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-08 14:42:07 -08:00
Jeromy
d2e0d73bd5 flush pinning improvements
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-08 14:42:07 -08:00
Jeromy
1feea8bc5f flushing and shallow list names
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-08 14:42:07 -08:00
Lars Gierth
e59dc8e49d docker: move to ipfs/go-ipfs image name
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-02-06 04:28:45 +01:00
Jeromy Johnson
5a0b8023be Merge pull request #2256 from ipfs/feat/gx-libp2p
vendor libp2p with gx
2016-02-05 16:52:02 -08:00
Lars Gierth
ce0d62dca3 docker: save image space by excluding .git/
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-02-05 04:03:30 +01:00
Lars Gierth
c103efc1a9 sharness: disable t0300-docker-image on Circle CI
The actual tests for the IPFS daemon within the image,
which were added in the previous commits, made Circle CI unhappy.

Circle CI runs an old version of Docker
which still uses LXC instead of libcontainer.
The existing lxc-attach hack is testament to that.

We might be able to get it work [1][2]
but it's really not worth it at the moment,
and Circle CI isn't a good option for Docker things, right now.

[1] https://jpetazzo.github.io/2014/03/23/lxc-attach-nsinit-nsenter-docker-0-9/
[2] https://github.com/jpetazzo/nsenter

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-02-05 03:11:50 +01:00
Christian Couder
91322346e2 t0240: improvements
This:

- uses startup_cluster() from iptb-lib.sh,
- avoids running test_expect_success() inside test_expect_success()
  as it makes the output confusing,
- makes the number of test nodes easily configurable.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-04 22:42:02 +01:00
Christian Couder
78f2f10ccf iptb-lib: small improvements
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-04 22:32:49 +01:00
Lars Gierth
81c8cffee9 Rework the Dockerfile
- Have two Dockerfiles doing essentially the same,
  but optimized for build time (for tests)
  and image size (for Docker Hub)
- Fetch gx dependencies
- Expose port 4002 for utp
- Specify go version, currently 1.5.3-r0
- Create ephemeral fs-repo if none is mounted
- Have t0300-docker-image actually test IPFS, not just an echo
- Make everything a bit less hardcoded
- Remove dead shacheck

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-02-04 10:46:26 -08:00
Jeromy Johnson
585ef2b957 Merge pull request #2275 from ipfs/refactor-iptb-tests
Refactor iptb tests
2016-02-02 08:44:57 -08:00
Jeromy
c7c1e72eaf add sharness test
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-01 16:35:22 -08:00
Christian Couder
79b6297770 t0130: use startup_cluster() from iptb-lib.sh
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-01 23:23:53 +01:00
Christian Couder
e0a48ffcf6 iptb-lib: add startup_cluster()
While at it let's cleanup startup_cluster() too.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-01 23:22:35 +01:00
Christian Couder
8b875ebe77 t0121, t0130, t0240: use iptb-lib.sh
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-01 13:48:00 +01:00
Christian Couder
d1f15d445b iptb-lib: small cleanup
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-01 13:23:51 +01:00
Christian Couder
cacb1cc2d4 sharness: add lib/iptb-lib.sh
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-01 13:17:13 +01:00
Jeromy
2263539c1c do that last thing again
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-31 15:37:39 -08:00
Jeromy
c0101c0c4b update libp2p dep
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-31 10:19:50 -08:00
Jeromy
0e8a6700f9 correct go-log dep
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-30 09:34:10 -08:00
Jeromy
3d0aa592ec go-keyspace dep from libp2p added
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-30 09:34:08 -08:00
Jeromy
0e312f5caf initial vendoring of libp2p outside of the repo with gx
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-30 09:34:06 -08:00
Stephen Whitmore
81b9607c49 Merge pull request #2201 from noffle/unpin-2155
Resolve paths in 'pin rm' /wo network lookup
2016-01-25 17:17:47 -08:00
Stephen Whitmore
9745704f5f Slightly optimizes core.ResolveToKey().
This is done by skipping the step of resolving the final segment in the
path to a DAG node; instead preferring to look at the second-to-last
segmenet's links.

License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-01-24 23:31:05 -08:00
Juan Benet
a5c4c5d17c Merge pull request #2232 from lidel/cors-preflight-fix
Gateway: add support for HTTP OPTIONS request type
2016-01-23 19:56:24 -08:00
Marcin Rataj
15d717c165 CORS header tests for Gateway
- Implements
  https://github.com/ipfs/go-ipfs/pull/2232#issuecomment-173742385
- Separate test suite:
    - we don't want to pollute other gateway tests with CORS headers
    - (as of now) changing headers requires daemon restart anyway

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2016-01-22 23:41:33 +01:00
Juan Benet
a2b0287a5f Merge pull request #2141 from Kubuxu/patch-1
Add Server field in HTTP API response header
2016-01-21 23:31:25 -08:00
Juan Benet
ffe6c8576e Merge pull request #2021 from ipfs/fix/corsconfig
Fix SetAllowedOrigins
2016-01-21 23:03:23 -08:00
rht
f0801589b4 Add SetAllowedOrigins race test case
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2016-01-21 20:03:17 +07:00
Jakub Sztandera
981b389a04 Add Server field in HTTP API
Resolves #625
Included in tests.

License: MIT
Signed-off-by: Jakub (Kubuxu) Sztandera <kubuxu@gmail.com>
2016-01-20 18:30:39 +01:00
Christian Couder
2dd4f40c10 test/bin: remove ipfs-pin-stat
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-01-18 21:37:44 +01:00
Christian Couder
893ab6dc83 t0081: use 'ipfs pin ls <arg>' in test_pin_flagi()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-01-18 21:37:44 +01:00
Jeromy
39d0b33507 address CR feedback
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-16 17:51:08 -08:00
Jeromy
52da1e3293 fix bootstrapping bug and add real test for bootstrapping
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-16 16:05:46 -08:00
Stephen Whitmore
32ceaa61e8 Resolves paths in 'pin rm' without network lookup.
Fixes ipfs/go-ipfs#2155 by turning the hash path arguments into keys
and unpinning directly, rather than running a full core.Resolve on
them. This lets users fail fast when they try to remove pins that
they don't have locally.

Note that this will only work when the path is of the form <hash> or
/ipfs/<hash>. Given e.g. /ipfs/<hash>/foo, foo's key cannot be known
without first resolving <hash>, which may involve talking to the
network.

License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-01-16 03:11:36 +01:00
Jeromy Johnson
f89a915ca0 Merge pull request #2114 from ipfs/remove-jenkins
ci: remove dead jenkins code
2016-01-15 23:55:20 +01:00
Jeromy Johnson
b182e539f0 Merge pull request #2202 from noffle/hidden_files-2145
Lets 'ipfs add' include top-level hidden files
2016-01-15 20:40:52 +01:00
Stephen Whitmore
0828d1eb64 Lets 'ipfs add' add hidden files when explicit.
Fixes ipfs/go-ipfs/#2145. The --hidden switch (still) only affects
recursive adding.

License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-01-15 11:19:40 -08:00
Juan Benet
2d9f6a8367 Merge pull request #2137 from Dignifiedquire/app
Fix  appveyor
2016-01-15 12:11:41 -05:00
dignifiedquire
4f06a0d8bd Start fixing appveyor
License: MIT
Signed-off-by: dignifiedquire <dignifiedquire@gmail.com>
2016-01-15 17:27:21 +01:00
Christian Couder
14462092f8 test-lib: improve on previous fix
With GNU "grep" \b works but it's safer to use "egrep" which is also
POSIX rather than "grep" as not all the "grep"s out there might support \b.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-01-15 16:50:16 +01:00
Christian Couder
cd9c9a6525 .gitignore: clean up how 'test/bin' content is ignored
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-01-15 10:43:29 +01:00
Christian Couder
e6201151c6 t0081: fix greping pin type
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-01-15 10:27:21 +01:00
Christian Couder
7e8052ef32 test-lib: fix test_str_contains
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-01-15 09:54:44 +01:00
Jeromy
a99ad8a411 add tests for and fix {set/append}-data
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
d4ffc9454f refactor object patch command to work more betterer
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
9aea2c7895 fix shared node reference issue
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
4d5af93f43 vendor in new go-datastore
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
cb1c5c535c add sharness test for index.html content type
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
f4ba724dbe implement utp transport
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
f08c88c8bb feedback from CR
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
06c013bf67 cleanup and more testing
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
9e7e826b8a sort output in tests
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
be09205310 fixify tests
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
b2b415b57d fix some tests
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
dc2e343a99 add option to disable flushing files structure on writes
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Andrew Chin
b6f28dad1b Add a --pin option to ipfs add (allowing --pin=false)
Implements a solution for #1908

This PR replaces #1909

License: MIT
Signed-off-by: Andrew Chin <achin@eminence32.net>
2016-01-12 08:22:55 -08:00
Jeromy
38fab91013 address comments from CR
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
6faa70ee59 implement ipfs files command
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Tommi Virtanen
d83644628b sharness: Stop assuming leveldb Datastore
License: MIT
Signed-off-by: Tommi Virtanen <tv@eagain.net>
2016-01-12 08:22:55 -08:00
Tommi Virtanen
a5f9832937 gofmt generated assets
The generated file went through some changes because of differing
go-bindata versions.

License: MIT
Signed-off-by: Tommi Virtanen <tv@eagain.net>
2016-01-12 08:22:55 -08:00
Jeromy
b12ee40aba implement mark and sweep GC
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

dont GC blocks used by pinner

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

comment GC algo

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

add lock to blockstore to prevent GC from eating wanted blocks

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

improve FetchGraph

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

separate interfaces for blockstore and GCBlockstore

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

reintroduce indirect pinning, add enumerateChildren dag method

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:21:13 -08:00
Jeromy
de50b21562 using multistream muxer
* ID service stream
* make the relay service use msmux
* fix nc tests

Note from jbenet: Maybe we should remove the old protocol/muxer
and see what breaks. It shouldn't be used by anything now.

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2016-01-12 08:21:13 -08:00
Tommi Virtanen
e5b8ee4819 pin: Rewrite to store pins in IPFS objects
WARNING: No migration performed! That needs to come in a separate
commit, perhaps amended into this one.

This is the minimal rewrite, only changing the storage from
JSON(+extra keys) in Datastore to IPFS objects. All of the pinning
state is still loaded in memory, and written from scratch on Flush. To
do more would require API changes, e.g. adding error returns.

Set/Multiset is not cleanly separated into a library, yet, as it's API
is expected to change radically.

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:21:13 -08:00
Tommi Virtanen
531f0579a4 sharness: Don't assume we know all things that can create garbage
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

sharness: Don't assume we know all things that can create garbage

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:21:13 -08:00
Tommi Virtanen
5b96d4d6b8 sharness: fusermount -u is the documented way to unmount FUSE on Linux
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:17:17 -08:00
Tommi Virtanen
a3de9bf3a0 sharness: Use sed in a cross-platform safe way
OS X sed is documented as "-i SUFFIX", GNU sed as "-iSUFFIX". The one
consistent case seems to be "-iSUFFIX", where suffix cannot empty (or
OS X will parse the next argument as the suffix).

This used to leave around files named `refsout=` on Linux, and was
just confusing.

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:17:17 -08:00
Christian Couder
1fbbd1de15 Add and use a DOCKER prereq
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-01-10 20:19:23 +01:00
Christian Couder
d356ed0d53 sharness: add t0300-docker-image.sh
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-01-10 20:19:23 +01:00
Christian Couder
29ec4c06e4 test/ipfs-test-lib: add docker support
We have to do something special for CircleCI in docker_exec()
because "docker exec" doesn't work on CircleCi:

https://circleci.com/docs/docker#docker-exec

We indeed get "Unsupported: Exec is not supported by the lxc
driver" with CircleCi, when using "docker exec".

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-01-10 20:19:23 +01:00
Jeromy Johnson
4ba3a754ae Merge pull request #2147 from ipfs/reenable-ipns-test
reenable ipns sharness test now that iptb is fixed
2016-01-02 12:39:33 +01:00
Jeromy
ba33de36e3 reenable ipns sharness test now that iptb is fixed
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-01 19:38:18 -08:00
Jeromy
543f527bca fix typos in quick start doc
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-01 18:15:29 -08:00
Lars Gierth
711b95ed3b ci: remove dead jenkins code
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-01-01 15:11:32 -08:00
Jeromy
7fe0dadcd9 add a test
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-12-30 11:08:09 -08:00
Jeromy
de702ead33 add sharness test to verify requests look good
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-12-28 05:01:06 -08:00
Jeromy
d207e8b87c disable auto repo gc tests temporarily
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-12-27 14:55:19 -08:00
Christian Couder
57c4188a98 test/supernode_client/main: fix t.Fatal in a goroutine
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-12-14 22:31:57 +01:00
Juan Benet
4397adf51c Merge pull request #2041 from ipfs/t0080-osx-fix
t0080 improvements
2015-12-12 04:31:18 -05:00
Juan Benet
0f39687fb6 Merge pull request #2019 from ipfs/Dignifiedquire-fix/access-controll-headers
Dignifiedquire fix/access controll headers
2015-12-09 00:55:06 -08:00
Christian Couder
0d7ef453f8 t0080: improve 'ipfs refs --unique' test
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-12-05 08:45:35 +01:00
Christian Couder
715e0c915e t0080: improve last tests
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-12-05 08:20:27 +01:00
Christian Couder
5721a1050c t0020: cleanup dir with bad perms
This is needed on OSX otherwise the trash directory for the
t0020-init.sh test fails to be removed due to a permissions
error.

This fixes https://github.com/ipfs/go-ipfs/issues/2026

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-12-05 07:36:53 +01:00
Lars Gierth
dcc9a63a34 assets: fix gc example
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-12-03 03:25:28 +01:00
Juan Benet
1c53aea2d2 Merge pull request #2000 from nham/object_put_newline
Add newline to end of `ipfs object put` text output.
2015-12-02 03:40:27 -08:00
Jeromy
891a8d7656 no newlines in json objects
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-11-30 15:23:48 -08:00
Nick Hamann
d49a15f566 Add newline to end of the output for a few commands.
Commands affected:

 - ipfs object put
 - ipfs tar add
 - ipfs resolve
 - ipfs name resolve

License: MIT
Signed-off-by: Nick Hamann <nick@wabbo.org>
2015-11-29 11:50:48 -06:00
dignifiedquire
e09c397aba Try to fix tests
License: MIT
Signed-off-by: Friedel Ziegelmayer <dignifiedquire@gmail.com>
2015-11-25 20:11:20 +01:00
rht
54a9891822 Add gc auto test
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-11-15 18:50:51 +07:00
rht
48a33ffb67 Add fixed period repo GC + test
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-11-10 14:03:29 +07:00
Jeromy
94bdce63a7 vendor logging lib update
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-11-05 15:57:21 -08:00
Jeromy
0d35cc9aea set data and links nil if not present
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-11-02 23:38:36 -08:00
Jeromy
c7fb7ce17d cache ipns entries to speed things up a little
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-11-02 12:53:08 -08:00
rht
31115f51a0 Allow ipfs cat on ipns path
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-10-31 15:55:47 +07:00
Juan Benet
f703b2c375 Merge pull request #1886 from ipfs/fix/ThatPut
fixing putHandler
2015-10-31 01:03:33 -04:00
Henry
c1847e9f69 putHandler: addressed CR from @jbenet
License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-10-31 01:37:37 +01:00
Juan Benet
a93dbf6d01 Merge pull request #1913 from ipfs/test-ipfs-config
t0021: test 'ipfs config show'
2015-10-30 17:06:33 -04:00
Juan Benet
933b973394 Merge pull request #1912 from ipfs/t0220-bitswap-stat
t0220: add 'ipfs bitswap stat' tests
2015-10-30 17:06:25 -04:00
Juan Benet
d82ff148e5 Merge pull request #1847 from ipfs/sharness-coverage-script
Sharness coverage script
2015-10-30 17:04:37 -04:00
Christian Couder
bbe95b8ad4 t0021: test 'ipfs config show'
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-29 16:26:52 +01:00
Christian Couder
3e57460c87 t0220: show breakage with ipfs bitswap wantlist -p
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-29 15:37:58 +01:00
Christian Couder
1c279b936e t0220: add 'ipfs bitswap stat' tests
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-29 15:07:46 +01:00
Henry
b8b4e45665 fixing putHandler for --writable http gateway
I disabled this a long time ago and never refactored it. About time.

License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-10-28 08:11:56 +01:00
Jeromy
c023d187b5 update code to use new logging changes
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-27 11:04:56 -07:00
Juan Benet
4022d8b8bd Merge pull request #1885 from ipfs/fix/ndjson
put newlines between streaming json output objects
2015-10-27 06:24:02 -04:00
Juan Benet
fff95d6fff Merge pull request #1856 from ipfs/fix/id-self
allow ipfs id to work on self
2015-10-27 04:52:07 -04:00
Juan Benet
2963d2e169 Merge pull request #1871 from ipfs/test-commands-flags
t0010: add tests for 'ipfs commands --flags'
2015-10-27 04:47:46 -04:00
Jeromy
f130869b45 put newlines between streaming json output objects
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-25 22:38:38 -07:00
Christian Couder
d5da16faf6 test/Makefile: add coverage target
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 12:34:40 +02:00
Christian Couder
891b4c569e coverage_helper: better group long and short options
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 11:22:53 +02:00
Christian Couder
c321f0626a coverage_helper: use 'ipfs commands --flags'
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 09:15:15 +02:00
Christian Couder
e1ef4d6f54 coverage_helper: log found commands
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Christian Couder
292ef427d0 coverage_helper: refactor matching commands
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Christian Couder
46394ce452 coverage_helper: exclude variables definitions
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Christian Couder
6291662b89 coverage_helper: output a result
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Christian Couder
06c3a21c94 coverage_helper: match commands from both sources
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Christian Couder
33c6df6827 coverage_helper: get commands from 'ipfs commands'
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Christian Couder
5e3d3895f5 coverage_helper: refactor egreps
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Christian Couder
106b841398 coverage_helper: remove grep commands
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Christian Couder
5abf294cf7 coverage_helper: remove .ipfs
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Christian Couder
741c0e5e50 coverage_helper: remove more cruft
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Christian Couder
97a80e93ae Add first version of sharness_test_coverage_helper.sh
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-24 06:49:33 +02:00
Jeromy
5dc2c7e010 add sharness test for streaming output from daemon
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-21 15:01:51 -07:00
Juan Benet
a79a9e7759 Merge pull request #1868 from ipfs/t0060-alternative-nc-fix
t0060: fail if no nc
2015-10-20 12:24:39 -07:00
Christian Couder
8a3bf95365 t0010: add tests for 'ipfs commands --flags'
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-20 14:57:54 +02:00
Christian Couder
c424b4d5ad t0060: fail if no nc
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-20 10:00:56 +02:00
Jeromy
71288160b1 add small test to ensure ipfs id <self> works
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-19 22:07:39 -07:00
Lars Gierth
a872199714 config: update pluto's peerID
We lost its private key a while ago...

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-10-19 21:04:42 +02:00
Jeromy
1cef170243 add small sharness test to make sure output happens
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-18 19:50:15 -07:00
Christian Couder
e5031788fd t00{1,6}0: remove some useless cats
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-16 21:54:47 +02:00
Christian Couder
51d05fb8dc t0010: test 'ipfs commands' and 'ipfs * --help'
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-16 21:54:47 +02:00
Juan Benet
d6297c7498 Merge pull request #1823 from ForrestWeston/recurPin
Pin commands default to recursive
2015-10-16 08:43:25 -07:00
Juan Benet
751c69ee70 Merge pull request #1621 from ipfs/real-trailers
use go's built in handling of trailers and dont do custom chunking
2015-10-14 17:02:46 +08:00
ForrestWeston
01239147b7 changed pinning to be recursive by default
pin add, pin rm, and pin ls will be recursive unless
specified with '=false' eg. 'ipfs pin add -r=false <file>'
tests for pinning have been updated/added

License: MIT
Signed-off-by: ForrestWeston <Forrest.Weston@gmail.com>
2015-10-13 17:11:05 -07:00
Matt Bell
04482cbe41 Consolidated 'resolve' tests
License: MIT
Signed-off-by: Matt Bell <mappum@gmail.com>
2015-10-13 16:51:44 +07:00
Juan Batiz-Benet
dd8267b9e0 resolve sharness test
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-10-13 13:11:41 +07:00
Matt Bell
16e29dae77 sharness: Added tests for 'ipfs resolve'
License: MIT
Signed-off-by: Matt Bell <mappum@gmail.com>
2015-10-13 13:11:41 +07:00
Jeromy
e89f7b8ded use go's built in handling of trailers and dont do custom chunking
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

use go1.5 syntax to ensure builds on older versions fail

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

fix t0230

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-11 23:04:41 -07:00
Jeromy
c6f93380fc fix random bitswap hangs
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-11 22:10:19 -07:00
Jeromy
4ace45d930 vendor in new iptb code (and as a result, go-multiaddr-net and friends
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-11 22:10:16 -07:00
Forrest Weston
6e2435211f Added an xml decoder, Fixes #1612
License: MIT
Signed-off-by: Forrest Weston <forrest.weston@gmail.com>
2015-10-09 12:05:48 -07:00
rht
6ae0973e1f Add context to coreunix.Cat argument
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-10-04 23:10:43 +07:00
Christian Couder
e499ee4470 sharness: swap test_*cmp arguments
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-04 11:39:22 +02:00
Christian Couder
bf8adc6c69 t0044: fail when 'ipfs add' fails
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-04 11:39:22 +02:00
Christian Couder
7b81e4e885 t0220: use test_must_be_empty()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-04 11:39:22 +02:00
Christian Couder
93aa8d0fb3 t0220: check if 'ipfs bitswap' fails
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-04 11:39:22 +02:00
Juan Benet
d4938c9b0c Merge pull request #1777 from rht/test/add
Add trickle and chunker test
2015-10-03 19:40:31 -04:00
Juan Benet
979bcc8108 Merge pull request #1772 from ipfs/shell-quote
Shell quote
2015-10-03 19:34:43 -04:00
Juan Benet
d4ca23d349 Merge pull request #1785 from ipfs/improve-t0100
t0100: swap test_cmp arguments
2015-10-03 19:34:16 -04:00
Juan Benet
3e8f7bd3ff Merge pull request #1786 from ipfs/improve-t0120
Improve t0120
2015-10-03 19:34:09 -04:00
Christian Couder
69c2340e06 t0120: add missing &&
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-04 00:08:16 +02:00
Christian Couder
9b316e8c66 t0120: swap test_cmp arguments
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-04 00:06:17 +02:00
Christian Couder
3c3a9c974a t0100: swap test_cmp arguments
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-04 00:02:17 +02:00
Juan Benet
47a353de6a Merge pull request #1781 from ipfs/improve-t0240
Improve t0240
2015-10-03 18:00:22 -04:00
Juan Benet
513b75a889 Merge pull request #1783 from ipfs/improve-t0051
t0051: swap test_cmp arguments
2015-10-03 17:58:50 -04:00
Juan Benet
3eea954a78 Merge pull request #1784 from ipfs/improve-t0081
t0081: swap test_cmp arguments
2015-10-03 17:58:31 -04:00
Christian Couder
5686762055 t0081: swap test_cmp arguments
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-03 23:49:01 +02:00
Christian Couder
088aa1a623 ipfs-test-lib: clarify and simplify shellquote()
Let's first add a comment to explain why the wrapper printf()
is needed.

Then let's replace the last instructions by quotes inside the
wrapper printf() first argument, and let's also put there the
eventual space so that we can remove the printf on the above
line.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-03 23:35:44 +02:00
Jeromy
8f0623255d replace imports with absolute path instead of using symlink
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-03 14:30:50 -07:00
Christian Couder
8f102d2cbd t0051: swap test_cmp arguments
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-03 23:26:20 +02:00
Christian Couder
880f378932 t0240: swap 'resolve' and 'expected'
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-03 22:46:10 +02:00
Christian Couder
0f7f0495a6 t0240: use test_seq instead of seq
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-03 22:42:41 +02:00
Christian Couder
e6890e1b63 t0240: improve ipfsi()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-03 22:33:12 +02:00
Christian Couder
4cab9fe37e ipfs-test-lib: fix shellquote() on Mac OS
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-03 16:06:40 +02:00
Christian Couder
d352b0421b Add t0015-basic-sh-functions.sh
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-03 12:27:01 +02:00
rht
32d9bd76f3 sharness: add trickle and chunker test
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-10-03 09:03:09 +07:00
rht
220b9d22ae Move test add cat offline into t0040
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-10-03 08:48:22 +07:00
Jeromy
e5512b4115 make publish more configurable and add test for repub
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-30 11:03:44 -07:00
Jeromy
e202c6592f vendor in iptb and kingpin
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-30 11:03:02 -07:00
Jeromy
815a031f59 Implement ipns republisher
This commit adds a very basic process that will periodically go through
a list of given ids and republish the values for their ipns entries.

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-29 09:47:47 -07:00
Christian Couder
1bd182055b ipfs-test-lib: add shellquote()
This function can be usefull in many places.

See for example:

https://github.com/ipfs/go-ipfs/pull/1742

Git has `git rev-parse --sq-quote` that does the same thing.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-09-27 09:11:25 +02:00
Juan Benet
08e06764c8 Merge pull request #1742 from ipfs/test/gz
Sharness: add test for compression level
2015-09-26 18:36:36 -04:00
Cayman Nava
9634b25b63 remove hard-coded json content-type for streaming http output
There was a stale assumption that streaming output from a channel would
always be json.
This commit removes that code, allowing Content-Type to appropriately be
set like other, non-channel-streaming commands.

License: MIT
Signed-off-by: Cayman Nava <caymannava@gmail.com>
2015-09-24 19:13:29 -07:00
rht
43dbd1cdb9 Sharness: add test for compression level
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-09-23 19:08:26 +07:00
Juan Benet
46e888bdfc Merge pull request #1701 from ipfs/feat/extract-logging
extract logging
2015-09-15 13:05:31 -04:00
Juan Benet
df861afccc Merge pull request #1672 from ipfs/feat/unwant
implement unwant command to remove blocks from wantlist
2015-09-15 00:57:57 -04:00
Jeromy
e5a2896c0e extract logging
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-14 17:35:50 -07:00
Jeromy
6c02259a5f add a basic test for unwant
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-14 15:26:09 -07:00
rht
23dd82f549 Fix t0090 tar&gz unexpected EOF error
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-09-14 01:23:54 +07:00
Christian Couder
6e59b39b74 test-lib: improve test_check_peerid
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-09-12 19:27:55 +02:00
Christian Couder
e22cbcec27 t0100: add peerid check
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-09-12 19:16:54 +02:00
Christian Couder
bec8224a0e t0062: add peerid check
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-09-12 19:14:34 +02:00
Christian Couder
9563cb29d9 t0110: add peerid check
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-09-12 19:10:18 +02:00
Christian Couder
0aa59368e4 t0060: simplify peerid check
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-09-12 19:06:50 +02:00
Christian Couder
5c118a20d7 sharness: generalize test_check_peerid()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-09-12 19:00:26 +02:00
Jeromy
7496df76d2 vendor binary deps in test/dependencies
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-10 18:09:12 -07:00
Jeromy
533a729949 add sharness test for tar commands
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-10 17:11:35 -07:00
Juan Benet
408bea3797 Merge pull request #1641 from rht/namedpipe
Serialfile: Explicit err on unrecognized file type
2015-09-05 03:19:54 +02:00
rht
8ec121239e Bump version of dir-index-html
Based on https://github.com/ipfs/go-ipfs/pull/1615

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-09-05 01:06:35 +07:00
rht
1b26ca724f Add test for ipfs add err for unsupported file type
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-09-04 18:04:56 +07:00
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
gatesvp
e55a130b49 Add hidden file support to add
License: MIT
Signed-off-by: Gaetan Voyer-Perrault <gatesvp@gmail.com>
2015-07-09 04:07:34 -07:00
Henry
1b16712b5a assets: seed gateway index assets on 'ipfs init'
License: MIT
Signed-off-by: Henry <cryptix@riseup.net>

t0080-repo.sh: added gateway assets to pinning tests

License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-07-04 01:47:07 +02:00
Henry
358d04c606 sharness/t0110-gateway: add simple 404 check for non existent file
License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-07-04 00:51:42 +02:00
Juan Batiz-Benet
8143d381c1 Merge pull request #1441 from rht/path-validate
Remove redundant path validation
2015-07-03 15:23:17 -07:00
rht
44245fe015 Add test to detect invalid path
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-04 02:50:15 +07:00
Henry
624c6e8fe5 assets: fix typo
closes #1343

License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-07-03 10:59:08 +02:00
Henry
5fbf1e7416 assets: switch to go-bindata
License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-07-03 09:52:08 +02:00
Juan Batiz-Benet
c595cf8ae0 config: DialBlocklist -> Swarm.AddrFilters
This commit changes the DialBlocklist key to be under the key
Swarm.AddrFilters instead.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-02 16:11:46 -07:00
Juan Batiz-Benet
a119b72243 t0141-addfilter: check init has no filters
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-02 16:10:30 -07:00
Jeromy
57d7a443a0 test dialblocklist loading from config
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-02 13:38:15 -07:00
Jeromy
7cc73f7b86 add command to manipulate address filters and a sharness test for them
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-30 18:25:34 -07:00
Juan Batiz-Benet
6b8e9f51fe fix t0061-daemon-opts.sh nc wait
fix the nc wait. the issue was that stdin needs to remain _open_
but not receive any input for some time. If stdin receives (invalid)
input or closes, the other side terminates the connection before
writing out the muxer frames + identify handshake.

This commit also changes the use of `!` for `test_must_fail`

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-26 23:36:43 -07:00
Juan Batiz-Benet
f300e97c50 added sharness/t0061-daemon-opts
Test odd daemon options, like:
- unrestricted-api
- disable-transport-encryption (known breakage atm)

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-26 23:36:43 -07:00
Juan Batiz-Benet
9716018ca5 daemon output includes swarm addresses
daemon output now includes initial swarm addresses. this is not a
full solution, as a change in network will not trigger re-printing.
We need a good way to do that.

This made me re-think how we're outputting these messages, perhaps
we should be throwing them as log.Events, and capturing some with
a special keyword to output to the user on stdout. Things like
network addresses being rebound, NATs being holepunched, external
network addresses being figured out, connections established, etc
may be valuable events to show the user. Of course, these should be
very few, as a noisy daemon is an annoying daemon.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-26 23:36:43 -07:00
Juan Batiz-Benet
500f51300d ipfs swarm addrs local - show local addrs
Add a command to return local addresses.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-26 23:36:42 -07:00
Juan Batiz-Benet
748d25f473 t0060-daemon: test transport is encrypted
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-26 23:36:42 -07:00
Christian Couder
1a77297182 t0060: export IPFS_PATH
IPFS_PATH should really be exported to make sure it is
available to the ipfs binary.

It looks like sharness tests fail otherwise on CircleCi.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-26 02:07:57 -07:00
Juan Batiz-Benet
ac7d25c2cc Merge pull request #1423 from ipfs/test/only-hash
add test for only-hash to ensure no blocks are added to datastore
2015-06-25 14:07:03 -07:00
Jeromy Johnson
0332f3dbaa Merge pull request #1348 from ipfs/tk/unixfs-ls
Add 'ipfs file ls …'
2015-06-25 10:03:52 -07:00
Jeromy
53dee3c64d add test for only-hash to ensure no blocks are added to datastore
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-25 09:33:47 -07:00
Jeromy
60ad7a5afc sharness tests for --only-hash
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-23 09:04:31 -07:00
W. Trevor King
4acab79d66 core/commands/unixfs/ls: Explicitily record stat in LsObject
Instead of abusing a LsLink for non-directory objects [1].

[1]: https://github.com/ipfs/go-ipfs/pull/1348#discussion_r32680669

License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-20 13:34:47 -07:00
W. Trevor King
5fd4812b20 core/commands/unixfs/ls.go: Fix (and test) single-directory listing
We don't want to prefix these results with the argument.  If there was
only one argument, the unprefixed results are still explicit.

License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-20 13:34:47 -07:00
W. Trevor King
7fc2410d95 core/commands/unixfs/ls: Hash-map for Objects
Discussion with Juan on IRC ([1] through [2]) lead to this adjusted
JSON output.  Benefits over the old output include:

* deduplication (we only check the children of a given Merkle node
  once, even if multiple arguments resolve to that hash)

* alphabetized output (like POSIX's ls).  As a side-effect of this
  change, I'm also matching GNU Coreutils' ls output (maybe in POSIX?)
  by printing an alphabetized list of non-directories (one per line)
  first, with alphabetized directory lists afterwards.

[1]: https://botbot.me/freenode/ipfs/2015-06-12/?msg=41725570&page=5
[2]: https://botbot.me/freenode/ipfs/2015-06-12/?msg=41726547&page=5

License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-20 13:34:47 -07:00
W. Trevor King
f0a0ac1b83 core/commands/unixfs/ls: Use a stringified type name
This doesn't affect the text output, which was already using a
stringified name.  The earlier stringification does change the JSON
output from an enumeration integer (e.g. 2) to the string form
(e.g. "File").  If/when we transition to Merkle-object types named by
their hash, we will probably want to revisit this and pass both the
type hash and human-readable-but-collision-prone name on to clients.

License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-20 13:34:47 -07:00
W. Trevor King
c9733c5da7 core/commands/unixfs/ls: Set Argument in JSON output
Change the approach to the directory-header control so we can set the
Argument value in the JSON response.

Stripping the trailing newline from the JSON output is annoying, but
looking over [1] I saw no easy way to add a newline to the JSON
output.  And with the general framework that commands/ attempts to be,
it feels a bit funny to customize the JSON output for a command-line
program.  Perhaps a workable solution is to have the command-line
client append newlines to any output that otherwise lacks them?  But
that seems like a change best left to a separate series.

[1]: http://golang.org/pkg/encoding/json/

License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-20 13:34:44 -07:00
Jeromy Johnson
7d254aef20 Merge pull request #1404 from ipfs/feat/patch-path
allow patch add-link to add at a path
2015-06-19 22:01:57 -07:00
Jeromy
d585e20ebc allow patch add-link to add at a path
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-19 20:45:20 -07:00
W. Trevor King
e700c02cbd core/commands/publish: Allow explicit local node ID
Instead of raising "keychains not yet implemented" whenever we have an
explicit node ID, only raise the error when the given node ID isn't
the local node.  This allows folks to use the more-general
explicit-node-ID form in scripts and such now, as long as they use the
local node name when calling those scripts.

Also add a test for this case, and update the comment for the
one-argument case to match the current syntax for extracting a
multihash name string.

License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-19 04:08:43 -07:00
Jeromy
96e98a8e13 add sharness test for log endpoint
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-18 12:44:02 -07:00
rht
18f5fcea28 golint util/, thirdparty/
and exchange/bitswap/testutils.go

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-06-18 10:03:57 +07:00
Juan Batiz-Benet
c73d0e0b56 Merge pull request #1346 from ipfs/tk/ls-trailing-tabs
core/commands/ls: Remove trailing tabs
2015-06-16 16:42:13 -07:00
Christian Couder
408a818b4a ipfs-test-lib: use test_seq from sharness
As Sharness now includes test_seq we can remove
our implementation.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-14 11:21:32 +02:00
Christian Couder
0befe2bf88 install-sharness.sh: update sharness
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-13 22:40:34 +02:00
Christian Couder
ac9f441f1f sharness/Makefile: force sharness version check
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-13 22:39:37 +02:00
Christian Couder
3101df56fa install-sharness.sh: implement updates
We want to be able to update Sharness to benefit from
new features.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-13 22:36:47 +02:00
W. Trevor King
3e6905e8ba core/commands/unixfs: Rename 'ipfs unixfs' to 'ipfs file'
To be less confusing to newcomers (the IPFS filesystem isn't
Unix-specific anyway, and it isn't even very POSIX-specific [1,2,3]).
I'm a bit uncertain about having one name for users and another for
devs, but the consensus seems to be that mainaining two names is worth
the trouble [4].  We also kicked around:

* 'files' (plural),
* 'filesystem' (too long), and
* 'fs' (redundant after 'ipfs', even though IPFS isn't just about
  filesystems)

on IRC [5 through 6].  I wish there was a more evocative term.  I'm
never sure where "file" lands on the scale between "filesysytem",
"everything is a file", "a single chunk of data with an associated
inode".  But we can't think of anything better.

[1]: https://github.com/ipfs/go-ipfs/pull/1348#issuecomment-110529070
[2]: https://github.com/ipfs/go-ipfs/pull/1348#issuecomment-110529921
[3]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29377283
  In my response to this (no longer visibile on GitHub):

  On Wed, Apr 29, 2015 at 01:30:04PM -0700, Juan Batiz-Benet wrote:
  > > +package fsnode
  >
  > i think this package should be called `unixfs` as that's the
  > abstraction that this is calling to.

  Will do, although I don't see what's especially Unix-y about these
  file nodes.

[4]: https://github.com/ipfs/go-ipfs/pull/1348#issuecomment-110529811
[5]: https://botbot.me/freenode/ipfs/2015-06-09/?msg=41428456&page=5
[6]: https://botbot.me/freenode/ipfs/2015-06-09/?msg=41430703&page=5

License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-13 13:07:13 -07:00
W. Trevor King
663f37cb99 core/commands/unixfs/ls: Don't recurse into chunked files
Folks operating at the Unix-filesystem level shouldn't care about that
level of Merkle-DAG detail.  Before this commit we had:

  $ ipfs unixfs ls /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox
  /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox:
  ... several lines of empty-string names ...

And with this commit we have:

  $ ipfs unixfs ls /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox
  /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox

I also reworked the argument-prefixing (object.Argument) in the output
marshaller to avoid redundancies like:

  $ ipfs unixfs ls /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox
  /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox:
  /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox

As a side-effect of this rework, we no longer have the trailing blank
line that we used to have after the final directory listing.

The new ErrImplementation is like Python's NotImplementedError, and is
mostly a way to guard against external changes that would need
associated updates in this code.  For example, once we see something
that's neither a file nor a directory, we'll have to update the switch
statement to handle those objects.

License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-13 13:06:34 -07:00
W. Trevor King
434871ba18 core/commands/unixfs: Add 'ipfs unixfs ls ...'
This is similar to 'ipfs ls ...', but it:

* Lists file sizes that match the content size:

    $ ipfs --encoding=json unixfs ls /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4
    {
      "Objects": [
        {
          "Argument": "/ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4",
          "Links": [
            {
              "Name": "busybox",
              "Hash": "QmPbjmmci73roXf9VijpyQGgRJZthiQfnEetaMRGoGYV5a",
              "Size": 1947624,
              "Type": 2
            }
          ]
        }
      ]
    }
    $ ipfs cat /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox | wc -c
    1947624

  'ipfs ls ...', on the other hand, is using the Merkle-descendant
  size, which also includes fanout links and the typing information
  unixfs objects store in their Data:

    $ ipfs --encoding=json ls /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4
    {
      "Objects": [
        {
          "Hash": "/ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4",
          "Links": [
            {
              "Name": "busybox",
              "Hash": "QmPbjmmci73roXf9VijpyQGgRJZthiQfnEetaMRGoGYV5a",
              "Size": 1948128,
              "Type": 2
            }
          ]
        }
      ]
    }

* Has a simpler text output corresponding to POSIX ls [1]:

    $ ipfs unixfs ls /ipfs/QmV2FrBtvue5ve7vxbAzKz3mTdWq8wfMNPwYd8d9KHksCF/gentoo/stage3/amd64/2015-04-02
    bin
    dev
    etc
    proc
    run
    sys
    $ ipfs ls /ipfs/QmV2FrBtvue5ve7vxbAzKz3mTdWq8wfMNPwYd8d9KHksCF/gentoo/stage3/amd64/2015-04-02
    QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4 1948183 bin/
    QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn 4       dev/
    QmUz1Z5jnQEjwr78fiMk5babwjJBDmhN5sx5HvPiTGGGjM 1207    etc/
    QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn 4       proc/
    QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn 4       run/
    QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn 4       sys/

  The minimal output allows us to start off with POSIX compliance and
  then add options (which may or may not be POSIX compatible) to
  adjust the output format as we get a better feel for what we need
  ([2] through [3]).

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html
[2]: https://botbot.me/freenode/ipfs/2015-06-12/?msg=41724727&page=5
[3]: https://botbot.me/freenode/ipfs/2015-06-12/?msg=41725146&page=5

License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-13 12:44:26 -07:00
W. Trevor King
15135e10df core/commands/ls: Remove trailing tabs
Since 607468a9 (beautify 'ipfs ls' and 'ipfs object links', #833)
we've had these.  That pull request was about text/tabwriter [1] and
elastic tabstops [2], but we don't need a column separator at the end
of each line.

[1]: https://golang.org/pkg/text/tabwriter/
[2]: http://nickgravgaard.com/elastic-tabstops/index.html

Licence: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-09 06:23:44 -07:00
Jeromy
c214210354 add some basic testing for object patch 2015-06-08 10:19:26 -07:00
Christian Couder
14a3315dc7 sharness/test-lib: use go-sleep to sleep
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-07 10:29:08 +02:00
Christian Couder
fd449af227 test/Makefile: build go-sleep
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-07 10:28:13 +02:00
Christian Couder
59cac0a161 test-lib: use test_seq()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-03 23:53:24 +02:00
Christian Couder
3c2e0ba586 ipfs-test-lib: implement test_seq()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-03 23:51:50 +02:00
Juan Batiz-Benet
898863d632 Merge pull request #1323 from ipfs/revert-godeps-update
Revert "godeps: update everything to master"
2015-06-03 14:26:16 -07:00
Jeromy
db98e77de9 add a test for issue repro 2015-06-03 08:41:25 -07:00
rht
9bdc1d6060 Test repeat in 10 sec: increase check frequency tenfold 2015-06-03 16:49:03 +07:00
Jeromy
ef294431d4 move util.Key into its own package under blocks 2015-06-01 16:10:08 -07:00
Juan Batiz-Benet
0f7f8ead04 disable constantly failing iptb tests
the iptb tests are failing all the time on travis. It's possible
this is still a port problem, and it may be something else.
Regardless, right now they're just adding noise.
2015-05-31 16:05:31 -07:00
Juan Batiz-Benet
109a618aca iptb sharness tests: randomize ports
Otherwise they clash with each other if running on the same machine
2015-05-31 14:59:03 -07:00
Juan Batiz-Benet
b5bd29a5d7 Merge pull request #1290 from ipfs/feat/bitswap-speed
move findproviders out of critical path
2015-05-31 14:30:27 -07:00
rht
f5d5095b1b Add newline to 'ipfs init' error message 2015-05-30 13:40:38 +07:00
rht
17d71c49ce Add test for no repo error message 2015-05-30 13:13:27 +07:00
Jeromy
f574cd4b80 Move findproviders out of main block request path
This PR moves the addition of new blocks to our wantlist (and their
subsequent broadcast to the network) outside of the clientWorker loop.
This allows blocks to more quickly propogate to peers we are already
connected to, where before we had to wait for the previous findProviders
call in clientworker to complete before we could notify our partners of
the next blocks that we want. I then changed the naming of the
clientWorker and related variables to be a bit more appropriate to the
model. Although the clientWorker (now named providerConnector) feels a
bit awkward and should probably be changed.

fix test assumption
2015-05-29 18:28:36 -07:00
Juan Batiz-Benet
ecdf14962c Merge pull request #1294 from rht/cleanup-tour
Cleanup tour
2015-05-29 16:59:17 -07:00
Henry
37b32a6587 sharness/daemon: improve error detection 2015-05-29 14:20:07 +02:00
Henry
dba455a59d sharness/t0060-daemon: don't reuse expect/actual names 2015-05-28 18:01:50 +02:00
rht
3547f7ae33 Replace 'var * bytes.Buffer' with '\1 := new(bytes.Buffer)' 2015-05-26 23:18:04 +07:00
Christian Couder
ee3092f882 t0040: test ipfs add with stdin
Let's test 'ipfs add' with stdin input too.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-23 21:02:24 +02:00
Jeromy
cc905539ae trying to debug permissions failure 2015-05-21 17:24:38 -07:00
Jeromy
60ac59139c fix offline full path resolution bug 2015-05-21 14:45:30 -07:00
Jeromy
8ea502f1b3 clean up and fix init permissions handling 2015-05-20 09:46:09 -07:00
W. Trevor King
e4447b3c96 core/commands/publish: Fix published message
Previously we had a confusing situation, with:

* single-arg doc: published name <name> to <value>
* double-arg doc: published name <value> to <name>
* implementation: Published name <name> to <value>

Now we have the uniform:

  Published to <name>: <value>

With the following goals:

1. It's clear that we're writing <value> to <name>'s IPNS slot in the
   DHT.
2. We preserve the order of arguments from the command-line
   invocation:

     $ ipfs name publish <name> <value>
     Published to <name>: <value>
2015-05-20 08:40:44 -07:00
Christian Couder
863f386251 t0040: add tests for ipfs cat with stdin
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-19 21:28:17 +02:00
rht
1e38f71a38 Add gofmt check 2015-05-19 06:11:15 +07:00
Juan Batiz-Benet
c946dbede3 sharness: randomize swarm address too.
This may take care of the daemon clashing on travis.
2015-05-10 08:28:35 -04:00
Juan Batiz-Benet
6dd8aeb00a config set: allow arbitrary json input
This commit allows arbitrary json input to set.
It also tests this with sharness.
2015-05-10 08:28:35 -04:00
Henry
f640ba0089 core: add context.Context param to core.Resolve()
commands/object: remove objectData() and objectLinks() helpers
resolver: added context parameters
sharness: $HASH carried the \r from the http protocol with
sharness: write curl output to individual files
http gw: break PUT handler until PR#1191
2015-05-08 03:14:32 +02:00
Jeromy Johnson
95f01537a3 correct the blocksize calculation for link blocks
update hash for bigfile
2015-05-06 01:04:15 -07:00
Jeromy
9cf8c5cbc9 update iptb dependency and use different ports for each iptb cluster
update iptb dependency again, and pick different ports for each iptb cluster

try and fix godeps crap
2015-05-04 19:45:44 -07:00
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
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