Close proxy listener if session is no longer active (#4850)

* Close proxy listener if session is no longer active
This commit is contained in:
Todd authored and GitHub committed 2024-05-30 16:12:17 -07:00
1 parent 4fd49f00f6
commit 98b5e3fa52
3 files changed
+50

No files matched your search

+12
View File
@@ -9,6 +9,7 @@ import (
"testing"
"time"
"github.com/hashicorp/boundary/api"
"github.com/hashicorp/boundary/api/targets"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -96,4 +97,15 @@ func Test_GetOpts(t *testing.T) {
require.NoError(t, err)
assert.Equal(3*time.Millisecond, opts.withSessionTeardownTimeout)
})
t.Run("withSessionsClient", func(t *testing.T) {
assert := assert.New(t)
opts, err := getOpts()
require.NoError(t, err)
assert.Nil(opts.withApiClient)
client, err := api.NewClient(nil)
require.NoError(t, err)
opts, err = getOpts(WithApiClient(client))
require.NoError(t, err)
assert.Equal(client, opts.withApiClient)
})
}