Commit Graph

119 Commits

Author SHA1 Message Date
Peter Rabbitson
153e52929a Make the docker check more specific
Docker on a mac might be available, but may not be runnng. The
way the original test was written is linux-specific anyway, so
just hoist the check into the DOCKER declaration
2019-12-23 15:41:30 +01:00
Peter Rabbitson
ba3a7d4a55 socat is not part of any default install, make tests conditional
54b1969c4b correctly switched from nc to socat, but did not account for it
not being as widely available. Adjust tests that depend on it with the
correct message.

There are also a number of comments pertaining to nc - they were not
adjusted.
2019-12-23 15:41:30 +01:00
Steven Allen
ff8e4fc89f test(sharness): fix tests for /ipfs -> /p2p change 2019-12-14 19:41:05 +01:00
Steven Allen
c93adf6701 test(sharness): fix flaky repo test
Just make sure we've removed all the blocks. We can't guarantee that the size
will revert.
2019-10-29 00:20:37 -07:00
Steven Allen
460c2119e4 daemon: support unix domain sockets for the API/gateway
All the work was client-side. Unix domain socket multiaddrs already worked
server-side.

fixes #4218
2019-09-30 17:21:28 -07:00
Dominic Della Valle
e7e7000611 add init config tests 2019-08-28 19:00:38 -04:00
Cole Brown
f5ea1af519 Use 2048 bit RSA keys in sharness and bench 2019-08-23 14:26:20 -07:00
Michael Avila
8f03df805b
Move sharness test helpers
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-05-29 16:20:32 -07:00
Michael Avila
6d6ce8fba7
Introduce first strategic provider: do nothing
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-05-29 16:20:31 -07:00
Travis Person
569eeb8f82 Update IPTB test - WIP
Related to #5521

License: MIT
Signed-off-by: Travis Person <travis@protocol.ai>
2018-11-01 19:33:05 -07:00
Jakub Sztandera
a4fab7f885 fix(sharness): gc repo size tests failing
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2018-10-15 09:26:28 +01:00
Steven Allen
67ea8dde0e test the correct return value
`res=$?` erases `$?` (sets it to 0)

fixes #5577

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-10-10 10:08:54 +01:00
Łukasz Magiera
6fa2ab0d41 coreapi swarm: rewire address listing cmds
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-09-26 22:17:23 +02:00
keks
908ffddc1b big squash commit
excerpt of commit messages:
- update postrun functions in core/commands
- sharness: allow setting -i with TEST_IMMEDIATE=1
- cmds Run func returns error now
- gx update cmdkit to 1.1.2 and cmds to 2.0.0-beta1

License: MIT
Signed-off-by: keks <keks@cryptoscope.co>
2018-09-19 14:35:54 -07:00
Steven Allen
0252710020 remove Godeps
fixes #2722

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-09-11 12:11:24 -07:00
Steven Allen
c1e10dbc4e add correct test for 1515
When checking to see if GC fully reverses an `ipfs add`, we should check the
size of the actual files, not the directory sizes. A bunch of empty directories
won't use *that* much space and really shouldn't count against GC.

closes #1515

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-08-11 09:53:52 -07:00
Steven Allen
abad8ca76e wait for the nodes to fully stop
Ideally, we'd fix this in IPTB but I'm tired of this bug and this is the easy
fix.

fixes #5272

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-30 16:21:25 -07:00
Steven Allen
cb0ad0d6ce fix starting iptb nodes with additional arguments
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-06 23:33:12 -07:00
Steven Allen
8f95badb12 cat iptb logs on iptb failure (for debugging CI)
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-03 12:47:52 -07:00
Łukasz Magiera
9b4296d9fd ci: Collect test times for sharness
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-04-21 22:40:03 +02:00
Łukasz Magiera
6b3915ba90 ci: run go vet, disable docker on jenkins
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-04-10 18:31:25 +02:00
Łukasz Magiera
3e41b15906 sharness: Don't escape colors in junit xml
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-04-10 18:31:25 +02:00
Łukasz Magiera
d25e82616e sharness/junit: Better test tree in jenkins
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-04-10 18:31:25 +02:00
Łukasz Magiera
d6fe0c195d ci: New Jenkinsfile
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-04-10 18:31:25 +02:00
Łukasz Magiera
b2b68c8214 sharness/junit: review
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-04-10 18:31:25 +02:00
Łukasz Magiera
3eb614fcb2 sharness: Generate JUnit test reports
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-04-10 18:31:25 +02:00
keks
4b9c36b072 sharness: increase timeout waiting for api file
License: MIT
Signed-off-by: keks <keks@cryptoscope.co>
2018-01-21 11:11:47 -08:00
Steven Allen
af21ae129d politely ask programs to not print ANSI codes by setting TERM to dumb
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-14 08:41:57 -08:00
Kevin Atkinson
2aeaf6309d Always set IPFS_PATH in test-lib.sh
Before it was only set when "test_init_ipfs" is called but that is
not always used, for example in t0025-datastores.sh.

License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2017-12-08 14:12:26 -05:00
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