-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow daemon to start correctly if the API is null (#10062)
- Loading branch information
Showing
3 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cli | ||
|
||
import ( | ||
"os/exec" | ||
"testing" | ||
|
||
"github.com/ipfs/kubo/test/cli/harness" | ||
) | ||
|
||
func TestDaemon(t *testing.T) { | ||
t.Parallel() | ||
|
||
t.Run("daemon starts if api is set to null", func(t *testing.T) { | ||
t.Parallel() | ||
node := harness.NewT(t).NewNode().Init() | ||
node.SetIPFSConfig("Addresses.API", nil) | ||
node.Runner.MustRun(harness.RunRequest{ | ||
Path: node.IPFSBin, | ||
Args: []string{"daemon"}, | ||
RunFunc: (*exec.Cmd).Start, // Start without waiting for completion. | ||
}) | ||
|
||
node.StopDaemon() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters