kubo/test
Andrew Gillis 6f6f04543b
Improve error message when running key command that locks repo (#7821)
* Improve error message when running key commands that must be run when the daemon is not already running

Fixes Issue #7814

`ipfs key export` now does a PreRun check like `ipfs key rotate` was to give a better error to the user then "someone else has the lock" in the event that the daemon is running while trying to execute these offline-only commands.

While unlikely the "someone else has the lock" error can still be shown if two processes try and grab the repo lock at the same time.

This PreRun function is also exported so it can be used by `ipfs init` where it was originally copied from.

* Added more `ipfs key` command tests

When daemon is running:
- Test that import works
- Test that export fails
- Test that rotate fails
2021-01-28 15:15:49 -05:00
..
3nodetest Fix typos and cleanup 2020-04-20 22:00:01 +03:00
api-startup misc: Remove some dead code 2018-03-21 01:34:04 +01:00
bench Use 2048 bit RSA keys in sharness and bench 2019-08-23 14:26:20 -07:00
bin test(graphsync): test server-side graphsync 2020-02-26 09:11:17 -08:00
dependencies Upgrade graphsync deps 2020-08-17 12:23:59 +02:00
integration chore: update dht and kbucket 2020-08-25 21:13:18 -04:00
sharness Improve error message when running key command that locks repo (#7821) 2021-01-28 15:15:49 -05:00
unit make: Replace json-to-junit with gotestsum 2019-03-05 18:33:58 +01:00
.gitignore test: add IPFS-BUILD-OPTIONS to .gitignore 2015-04-06 18:06:24 +02:00
ipfs-test-lib.sh Fix typos and cleanup 2020-04-20 22:00:01 +03:00
README.md test/README: update sharness test coverage 2015-04-02 11:56:49 +02:00
Rules.mk ci: Coverage and Junit xmls in one run 2018-10-29 18:44:49 +01:00
sharness_test_coverage_helper.sh Fix typos and cleanup 2020-04-20 22:00:01 +03:00

Sharness test command coverage

Module Online Test Offline Test
object t0051 t0051
ls t0045 t0045
cat t0040
dht
bitswap
block t0050
daemon t0030 N/A
init N/A t0020
add t0040
config t0021 t0021
version t0060 t0010
ping
diag
mount t0030
name t0110 t0100
pin t0080
get t0090 t0090
refs t0080
repo gc t0080
id
bootstrap t0120 t0120
swarm
update
commands