Skip to content

Commit

Permalink
Merge pull request #405 from Random-Liu/critest-support-runtime-handler
Browse files Browse the repository at this point in the history
Add `runtime-handler` flag in critest.
  • Loading branch information
k8s-ci-robot authored Nov 9, 2018
2 parents c080f38 + bcc6421 commit ef6bc62
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/benchmark/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var _ = framework.KubeDescribe("PodSandbox", func() {

// TODO: add support of runtime
operation := b.Time("create PodSandbox", func() {
podID, err = c.RunPodSandbox(config, "")
podID, err = c.RunPodSandbox(config, framework.TestContext.RuntimeHandler)
})

framework.ExpectNoError(err, "failed to create PodSandbox: %v", err)
Expand Down
2 changes: 2 additions & 0 deletions pkg/framework/test_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type TestContextType struct {
ImageServiceTimeout time.Duration
RuntimeServiceAddr string
RuntimeServiceTimeout time.Duration
RuntimeHandler string

// Benchmark setting.
Number int
Expand Down Expand Up @@ -65,5 +66,6 @@ func RegisterFlags() {
}
flag.StringVar(&TestContext.RuntimeServiceAddr, "runtime-endpoint", svcaddr, "Runtime service socket for client to connect..")
flag.DurationVar(&TestContext.RuntimeServiceTimeout, "runtime-service-timeout", 300*time.Second, "Timeout when trying to connect to a runtime service.")
flag.StringVar(&TestContext.RuntimeHandler, "runtime-handler", "", "Runtime handler to use in the test.")
flag.IntVar(&TestContext.Number, "number", 5, "Number of PodSandbox/container in listing benchmark test.")
}
3 changes: 1 addition & 2 deletions pkg/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ func BuildPodSandboxMetadata(podSandboxName, uid, namespace string, attempt uint

// RunPodSandbox runs a PodSandbox.
func RunPodSandbox(c internalapi.RuntimeService, config *runtimeapi.PodSandboxConfig) string {
// TODO: add support of runtime handler.
podID, err := c.RunPodSandbox(config, "")
podID, err := c.RunPodSandbox(config, TestContext.RuntimeHandler)
ExpectNoError(err, "failed to create PodSandbox: %v", err)
return podID
}
Expand Down

0 comments on commit ef6bc62

Please sign in to comment.