forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wrapper binary for conformance tests
Put the wrapper binary and the functest binary both inside a conformance container and push the resulting container as `kubevirt/conformance:<tag>` The wrapper will do all the necessary work and calls the functest binary the way which sonobuoy expects. To generate a sonobuoy plugin for a released conformance test suite, run ``` sonobuoy gen plugin --name kubevirt-conformance --cmd /usr/bin/conformance --image kubevirt/conformance:<tag> -f junit > kubevirt.yaml ``` Then luanch the suite: ``` sonobuoy run --plugin kubevirt.yaml ``` Signed-off-by: rmohr <[email protected]>
- Loading branch information
Showing
9 changed files
with
260 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"storageClassLocal": "local", | ||
"storageClassHostPath": "host-path", | ||
"storageClassBlockVolume": "block-volume", | ||
"storageClassRhel": "rhel", | ||
"storageClassWindows": "windows", | ||
"manageStorageClasses": false | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = ["conformance.go"], | ||
importpath = "kubevirt.io/kubevirt/tests/conformance", | ||
visibility = ["//visibility:private"], | ||
) | ||
|
||
go_binary( | ||
name = "conformance", | ||
testonly = True, | ||
embed = [":go_default_library"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"io/ioutil" | ||
"os" | ||
"os/exec" | ||
"strings" | ||
) | ||
|
||
func done(files []string) { | ||
err := ioutil.WriteFile("/tmp/results/done", []byte(strings.Join(files, "\n")), 0666) | ||
if err != nil { | ||
fmt.Printf("Failed to notify sonobuoy that I am done: %v\n", err) | ||
} | ||
} | ||
|
||
func main() { | ||
err := execute() | ||
done([]string{ | ||
"/tmp/results/junit.xml", | ||
}) | ||
if err != nil { | ||
os.Exit(1) | ||
} | ||
} | ||
|
||
func execute() error { | ||
args := []string{} | ||
args = append(args, "--junit-output", "/tmp/results/junit.xml") | ||
// additional conformance test overrides | ||
if value, exists := os.LookupEnv("E2E_SKIP"); exists { | ||
args = append(args, "--ginkgo.skip", value) | ||
} else { | ||
args = append(args, "--ginkgo.skip", "\\[Disruptive\\]") | ||
} | ||
if value, exists := os.LookupEnv("E2E_FOCUS"); exists { | ||
args = append(args, "--ginkgo.focus", value) | ||
} else { | ||
args = append(args, "--ginkgo.focus", "\\[Conformance\\]") | ||
} | ||
args = append(args, "--config", "/conformance-config.json") | ||
|
||
cmd := exec.Command("/usr/bin/functest", args...) | ||
cmd.Env = os.Environ() | ||
cmd.Env = append(cmd.Env, "ARTIFACTS=/tmp/results/") | ||
cmd.Stderr = os.Stderr | ||
cmd.Stdin = os.Stdin | ||
cmd.Stdout = os.Stdout | ||
err := cmd.Run() | ||
if err != nil { | ||
fmt.Printf("command failed with %v\n", err) | ||
return err | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters