Merge pull request #14618 from ahrtr/username_password_cont
test: add common function "WithAuth"dependabot/go_modules/go.uber.org/atomic-1.10.0
commit
b37532db8f
|
@ -17,8 +17,16 @@
|
|||
|
||||
package common
|
||||
|
||||
import "go.etcd.io/etcd/tests/v3/framework"
|
||||
import (
|
||||
"go.etcd.io/etcd/tests/v3/framework"
|
||||
"go.etcd.io/etcd/tests/v3/framework/config"
|
||||
"go.etcd.io/etcd/tests/v3/framework/e2e"
|
||||
)
|
||||
|
||||
func init() {
|
||||
testRunner = framework.E2eTestRunner
|
||||
}
|
||||
|
||||
func WithAuth(userName, password string) config.ClientOption {
|
||||
return e2e.WithAuth(userName, password)
|
||||
}
|
||||
|
|
|
@ -19,8 +19,14 @@ package common
|
|||
|
||||
import (
|
||||
"go.etcd.io/etcd/tests/v3/framework"
|
||||
"go.etcd.io/etcd/tests/v3/framework/config"
|
||||
"go.etcd.io/etcd/tests/v3/framework/integration"
|
||||
)
|
||||
|
||||
func init() {
|
||||
testRunner = framework.IntegrationTestRunner
|
||||
}
|
||||
|
||||
func WithAuth(userName, password string) config.ClientOption {
|
||||
return integration.WithAuth(userName, password)
|
||||
}
|
||||
|
|
|
@ -21,9 +21,10 @@ import (
|
|||
)
|
||||
|
||||
// ClientOption configures the client with additional parameter.
|
||||
// For example, if Auth is enabled,
|
||||
// 1. e2e test cases use e2e.WithAuth to return a ClientOption;
|
||||
// 2. integration test, uses integration.WithAuth to return a ClientOption.
|
||||
// For example, if Auth is enabled, the common test cases just need to
|
||||
// use `WithAuth` to return a ClientOption. Note that the common `WithAuth`
|
||||
// function calls `e2e.WithAuth` or `integration.WithAuth`, depending on the
|
||||
// build tag (either "e2e" or "integration").
|
||||
type ClientOption func(any)
|
||||
|
||||
type GetOptions struct {
|
||||
|
|
Loading…
Reference in New Issue