Commit Graph

90 Commits

Author SHA1 Message Date
Steven Allen
ba680b10da make sure the repo size is greater than the size of the symlink
Before, we'd check to make sure the repo, when checked through a symlink, is at
least as large as the repo *before* we checked it through the symlink. However,
this assumes that the repo can't shrink.

Really, this test exists to ensure we measure the repo size itself instead of
the size of the symlink; this commit changes the test to reflect this.

This test fails when 54d7e03303 is reverted.

fixes #4408

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-01 09:56:03 -08:00
Łukasz Magiera
6a40c37b94 sharness: 2 space indent
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-10-04 13:39:14 +02:00
Łukasz Magiera
fdccfea029 sharness: fix indent in few more places
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-10-04 13:35:07 +02:00
Sherod Taylor
bc75d3b88a Removed tour command and fix test
License: MIT
Signed-off-by: Sherod Taylor <sherodtaylor@gmail.com>
2017-08-09 10:14:57 -04:00
Steven Allen
39197ff8d3 sharness: fix the 'useful error message when adding a named pipe' test
We were removing the file before testing, ignoring the error from stat, and then
grepping for `Error: Unrecognized file type for named-pipe: ` (because nothing
was sent to stdout).

This fix:

1. Changes our stat command to output failed to stdout on failure to ensure that
bugs like this *can't* happen.
2. Checks to make sure stat actually succeeds.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-07-31 18:31:40 -07:00
Steven Allen
0ada88637b sharness: use test profile
This:

* Disables mdns and fixes #4098 (iptb nodes already have mdns disabled by
  default).
* Only listens on localhost (although iptb nodes still listen on all).

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-07-30 20:22:41 -07:00
Jakub Sztandera
b5ea00e6b4
sharness: add debug output for TEST_NO_PLUGIN
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-07-14 13:23:14 +02:00
Jakub Sztandera
285a4d8e10
test: add TEST_NO_PLUGIN and PLUGIN prereq
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-07-12 21:53:59 +02:00
Jakub Sztandera
dab716ba02
test: fix ulimit tests for 2048 fds
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-03-24 20:56:09 +01:00
Jakub Sztandera
e2ececa4fa
test: fix sharness disk_usage util
on bsd based systems du returns block count not bytes

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-03-08 00:07:18 +01:00
Lars Gierth
26770b7ebb
fsrepo: fix musl detection for migrations
The ldd command used for detection doesn't seem to have a
--version flag on Alpine Linux. It would print the expected
output, but instead of stdout, it would print it on stderr.

The musl detection code would only scan stdout for mentions
of "musl", and would thus *not* download the musl version
of the fs-repo-migrations executable.

This manifested in the well-known "fs-repo-migrations: not found"
error, which you get when executing something that was linked
against a different libc than the one present on the system.

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2017-02-17 08:37:26 +01:00
Jakub Sztandera
a2e3aa5d78
make: fix standalone sharness run
The comparison was wrong

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-02-12 01:18:40 +01:00
Jakub Sztandera
f630222580
make: rework makefiles for non-recursive make and add sharness coverage
This commit introduces non-recursive Makefile infrastructure that replaces current Makefile infrastructure.
It also generally cleanups the Makefiles, separates them into nicer sub-modules and centralizes common operations into single definitions.

It allows to depend on any target that is defined in the makefile, this means that for example `gx install` is called once when `make build test_expensive_sharness` is called instead of 4 or 5 times.

It also makes the dependencies much cleaner and allows for reuse of modules. For example sharness coverage collection (WIP) uses sharness target with amended PATH, previously it might have been possible but not without wiring in the coverage collection into sharness make runner code.

Yes, it is more complex but not much more. There are few rules that have to be followed and few complexities added but IMHO it is worth it.

How to NR-make:
1. If make is to generate some file via a target, it MUST be defined in Rules.mk file in the directory of the target.
2. `Rules.mk` file MUST have `include mk/header.mk` statement as the first line and `include mk/footer.mk` statement as the last line (apart from project root `Rules.mk`).
3. It then MUST be included by the closest `Rules.mk` file up the directory tree.
4. Inside a `Rules.mk` special variable accessed as `$(d)` is defined. Its value is current directory, use it so if the `Rules.mk` file is moved in the tree it still works without a problem. Caution: this variable is not available in the recipe part and MUST NOT be used. Use name of the target or prerequisite to extract it if you need it.
5. Make has only one global scope, this means that name conflicts are a thing. Names SHOULD  follow `VAR_NAME_$(d)` convention. There are exceptions from this rule in form of well defined global variables. Examples: General lists `TGT_BIN`, `CLEAN`; General targets: `TEST`, `COVERAGE`; General variables: `GOFLAGS`, `DEPS_GO`.
3. Any rules, definitions or variables that fit some family SHOULD be defined in `mk/$family.mk` file and included from project root `Rules.mk`

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-02-12 01:18:40 +01:00
Jan Winkelmann
993e7816f8 pubsub sharness tests after chriscool feedback
License: MIT
Signed-off-by: Jan Winkelmann <j-winkelmann@tuhh.de>
2016-12-04 03:22:51 +01:00
Jan Winkelmann
1b3158f860 add sharness test for pubsub
License: MIT
Signed-off-by: Jan Winkelmann <j-winkelmann@tuhh.de>
2016-12-04 03:22:49 +01:00
Lars Gierth
dae854eaf3 assets: rebuild them
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-11-03 00:38:32 +01:00
Jeromy
3d5e015876 add a test for auto-raising ulimit
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-06-22 11:17:16 -07:00
Jakub Sztandera
bdea10ff0e Make if condition in sharness lib silent
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-05-24 15:59:56 +02:00
Jakub Sztandera
7614f4f700 Create shanress test for offline mode node
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-05-24 15:59:56 +02:00
Christian Couder
c54c0456b7 test-lib: make checking for docker silent
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-05-07 13:14:11 +02: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
b66e089ec1 trailing whitespace
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
2016-02-29 16:05:48 -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
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
5a0b8023be Merge pull request #2256 from ipfs/feat/gx-libp2p
vendor libp2p with gx
2016-02-05 16:52:02 -08: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
78f2f10ccf iptb-lib: small improvements
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-04 22:32:49 +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
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
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
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
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
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
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
dcc9a63a34 assets: fix gc example
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-12-03 03:25:28 +01: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
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
5c118a20d7 sharness: generalize test_check_peerid()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-09-12 19:00:26 +02: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
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
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
rht
eb45082103 Add reversible gc test
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-28 09:47:15 +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
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
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