(t *testing.T, clientURL string, args ...string)
| 30 | } |
| 31 | |
| 32 | func setupKeyringTestEnv(t *testing.T, clientURL string, args ...string) keyringTestEnv { |
| 33 | t.Helper() |
| 34 | |
| 35 | var root cli.RootCmd |
| 36 | |
| 37 | cmd, err := root.Command(root.AGPL()) |
| 38 | require.NoError(t, err) |
| 39 | |
| 40 | serviceName := testhelpers.KeyringServiceName(t) |
| 41 | root.WithKeyringServiceName(serviceName) |
| 42 | root.UseKeyringWithGlobalConfig() |
| 43 | |
| 44 | inv, cfg := clitest.NewWithDefaultKeyringCommand(t, cmd, args...) |
| 45 | |
| 46 | parsedURL, err := url.Parse(clientURL) |
| 47 | require.NoError(t, err) |
| 48 | |
| 49 | backend := sessionstore.NewKeyringWithService(serviceName) |
| 50 | t.Cleanup(func() { |
| 51 | _ = backend.Delete(parsedURL) |
| 52 | }) |
| 53 | |
| 54 | return keyringTestEnv{serviceName, backend, inv, cfg, parsedURL} |
| 55 | } |
| 56 | |
| 57 | func TestUseKeyring(t *testing.T) { |
| 58 | // Verify that the --use-keyring flag default opts into using a keyring backend |
no test coverage detected