mirror of
https://github.com/kopia/kopia.git
synced 2025-12-23 22:57:50 -05:00
* feat(server): emit notifications as JSON to stderr when running under KopiaUI * added tests
28 lines
614 B
Go
28 lines
614 B
Go
package cli_test
|
|
|
|
import (
|
|
"syscall"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/kopia/kopia/internal/testutil"
|
|
"github.com/kopia/kopia/tests/testenv"
|
|
)
|
|
|
|
func TestTerminate(t *testing.T) {
|
|
env := testenv.NewCLITest(t, testenv.RepoFormatNotImportant, testenv.NewExeRunner(t))
|
|
|
|
env.RunAndExpectSuccess(t, "repo", "create", "filesystem", "--path", env.RepoDir)
|
|
|
|
var sp testutil.ServerParameters
|
|
|
|
wait, interrupt := env.RunAndProcessStderrInt(t, sp.ProcessOutput, nil, "server", "start",
|
|
"--address=localhost:0",
|
|
"--insecure")
|
|
|
|
interrupt(syscall.SIGTERM)
|
|
|
|
require.NoError(t, wait())
|
|
}
|