Close proxy listener if session is no longer active (#4850)
* Close proxy listener if session is no longer active
This commit is contained in:
3 files changed
+50
No files matched your search
@@ -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)
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user