1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 11:52:21 +08:00

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
This commit is contained in:
Juan Batiz-Benet
2015-01-31 19:15:46 -08:00
parent 4016d35a81
commit f1d34a2a85
9 changed files with 170 additions and 129 deletions

View File

@ -183,6 +183,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
if rootRedirect != nil {
opts = append(opts, rootRedirect)
}
fmt.Printf("Gateway server listening on %s\n", gatewayMaddr)
err := corehttp.ListenAndServe(node, gatewayMaddr.String(), opts...)
if err != nil {
log.Error(err)
@ -198,6 +199,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
if rootRedirect != nil {
opts = append(opts, rootRedirect)
}
fmt.Printf("API server listening on %s\n", apiMaddr)
if err := corehttp.ListenAndServe(node, apiMaddr.String(), opts...); err != nil {
res.SetError(err, cmds.ErrNormal)
return