-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: implement
talosctl conformance
command to run e2e tests
Command implements two modes: * `fast`: conformance suite is run at maximum speed * `certified`: conformance suite is run in serial mode, results are capture to produce artifacts ready for CNCF submission process Signed-off-by: Andrey Smirnov <[email protected]>
- Loading branch information
Showing
7 changed files
with
347 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
package talos | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/talos-systems/talos/pkg/cluster" | ||
"github.com/talos-systems/talos/pkg/cluster/sonobuoy" | ||
"github.com/talos-systems/talos/pkg/machinery/client" | ||
) | ||
|
||
// conformanceCmd represents the conformance command. | ||
var conformanceCmd = &cobra.Command{ | ||
Use: "conformance", | ||
Short: "Run conformance tests", | ||
Long: ``, | ||
} | ||
|
||
var conformanceKubernetesCmdFlags struct { | ||
mode string | ||
} | ||
|
||
var conformanceKubernetesCmd = &cobra.Command{ | ||
Use: "kubernetes", | ||
Aliases: []string{"k8s"}, | ||
Short: "Run Kubernetes conformance tests", | ||
Long: ``, | ||
Args: cobra.NoArgs, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return WithClient(func(ctx context.Context, c *client.Client) error { | ||
clientProvider := &cluster.ConfigClientProvider{ | ||
DefaultClient: c, | ||
} | ||
defer clientProvider.Close() //nolint:errcheck | ||
|
||
state := struct { | ||
cluster.K8sProvider | ||
}{ | ||
K8sProvider: &cluster.KubernetesClient{ | ||
ClientProvider: clientProvider, | ||
ForceEndpoint: healthCmdFlags.forceEndpoint, | ||
}, | ||
} | ||
|
||
switch conformanceKubernetesCmdFlags.mode { | ||
case "fast": | ||
return sonobuoy.FastConformance(ctx, &state) | ||
case "certified": | ||
return sonobuoy.CertifiedConformance(ctx, &state) | ||
default: | ||
return fmt.Errorf("unsupported conformance mode %v", conformanceKubernetesCmdFlags.mode) | ||
} | ||
}) | ||
}, | ||
} | ||
|
||
func init() { | ||
conformanceKubernetesCmd.Flags().StringVar(&conformanceKubernetesCmdFlags.mode, "mode", "fast", "conformance test mode: [fast, certified]") | ||
conformanceCmd.AddCommand(conformanceKubernetesCmd) | ||
addCommand(conformanceCmd) | ||
} |
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,31 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
package sonobuoy | ||
|
||
import "github.com/talos-systems/talos/pkg/version" | ||
|
||
type product struct { | ||
Vendor string `yaml:"vendor"` | ||
Name string `yaml:"name"` | ||
Version string `yaml:"version"` | ||
WebsiteURL string `yaml:"website_url"` | ||
RepoURL string `yaml:"repo_url"` | ||
DocumentationURL string `yaml:"documentation_url"` | ||
ProductLogoURL string `yaml:"product_logo_url"` | ||
Type string `yaml:"type"` | ||
Description string `yaml:"description"` | ||
} | ||
|
||
var talos = product{ | ||
Vendor: "Talos Systems", | ||
Name: "Talos", | ||
Version: version.Tag, | ||
WebsiteURL: "https://www.talos-systems.com", | ||
RepoURL: "https://github.com/talos-systems/talos", | ||
DocumentationURL: "https://www.talos.dev", | ||
ProductLogoURL: "https://www.talos-systems.com/images/TalosSystems_Horizontal_Logo_FullColor_RGB-for-site.svg", | ||
Type: "installer", | ||
Description: "Talos is a modern Kubernetes-focused OS designed to be secure, immutable, and minimal.", | ||
} |
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
Oops, something went wrong.