Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5928803
remove duplicate tests from openshift-tests-kubernetes
sallyom Feb 14, 2020
5ad13b7
Add CSI resizer to e2e tests
bertinatto Jan 16, 2020
5e4f6f9
Loosen help tests for oc rsh
soltysh Jan 20, 2020
d7d0353
test: Allow imagetags resource to be added to group RBAC
smarterclayton Jan 20, 2020
e5de901
move off more nodejs:8 references
gabemontero Jan 21, 2020
bdf65b6
test/extended/prometheus: Re-enable telemetry test
brancz Jan 22, 2020
6306ec6
UPSTREAM: 87432: fix flaky test "should create a ResourceQuota and ca…
deads2k Jan 22, 2020
0d4d118
test for excessive etcd leadership changes
sanchezl Dec 12, 2019
f8560df
UPSTREAM: <carry>: simplify the authorizer patch to allow the flags t…
deads2k Jan 21, 2020
2088dd6
test: Remove regexes in the wildcard selection, they are expensive
smarterclayton Jan 22, 2020
9e027c9
test: Generate test annotations rather than doing them dynamically
smarterclayton Jan 22, 2020
ced3022
test: Remove dependency on e2e in cloud config lookup
smarterclayton Jan 23, 2020
cc640ab
test/cmd: build.sh can't reach old openshift/origin:v1.1 image
smarterclayton Jan 23, 2020
ab7118c
Enable CSI snapshot tests
jsafrane Jan 25, 2020
d2d5f9e
image: add ImageTag to etcd test
mfojtik Jan 27, 2020
551414b
test: Test internal port connectivity internally for 9000-9999
smarterclayton Jan 24, 2020
60c6bad
test: Set appropriate cloud defaults even when not specified on tests
smarterclayton Jan 27, 2020
2524c8d
UPSTREAM: 85898: Fix multinode storage e2e tests for multizone clusters
tsmetana Jan 22, 2020
c51535a
Use --kubeconfig flag for Jenkins Tests
waveywaves Jan 23, 2020
37e9c5f
Move the oc explain tests for networking CRDs to a new test
abhat Jan 29, 2020
b84c27d
UPSTREAM: 82027: Enabled reading config files for vsphere e2e tests
huffmanca Jan 29, 2020
e25cc96
Update generated bindata
abhat Jan 29, 2020
ad67aeb
test/extended/prometheus: test if AlertmanagerReceiversNotConfigured …
paulfantom Dec 10, 2019
764c395
test/extended/util/annotate/generated: regenerate
paulfantom Jan 30, 2020
acc942f
test: Remove duplicate gingko recover from disruption tests
smarterclayton Jan 30, 2020
67c9e95
Bug 1796895: Don't use annotation in openshift/csi test suite
bertinatto Jan 31, 2020
33a7509
Revert Disable flaky tests on OpenStack b390f42a42
pierreprinetti Feb 3, 2020
b398cc1
test: Allow disruption tests to report partial failure
smarterclayton Feb 3, 2020
0f28911
UPSTREAM: <carry>: bootstrap user - make tokens have implicit audiences
stlaz Feb 5, 2020
9fd6f0d
Test if oc tag can work without imagestreamtags
Feb 5, 2020
c48ec09
UPSTREAM: 84614: kubelet: add certificate rotation error metric
rphillips Feb 6, 2020
2682a07
Bug 1789266: replace deprecated commands with current secrets commands
soltysh Jan 28, 2020
b642d03
pkg/test/ginkgo/cmd_runsuite.go: Add set of tests to run after all other
lilic Feb 3, 2020
9016cd4
test/extended/prometheus/prometheus.go: Run alerts tests after all tests
lilic Feb 3, 2020
8231aa0
test/extended/operators/operators.go: Renamed Smoke to Early
lilic Feb 5, 2020
ec683ef
test/extended/../generated/zz_generated.annotations.go: Regenerate
lilic Feb 3, 2020
2db9e51
test/extended/prometheus/prometheus.go: Fail tests if Prometheus cannot
lilic Feb 5, 2020
2b19a90
disable etcd metrics check to land operator
deads2k Feb 13, 2020
5c22097
UPSTREAM: 87673: blank out value for unbounded client label
sttts Feb 14, 2020
bad951b
test/extended/prometheus: temporarily disable etcdInsufficientMembers
hexfusion Feb 14, 2020
647c5f5
origin/test -> openshift-tests/test
sallyom Feb 16, 2020
bd0f865
generated
sallyom Feb 16, 2020
88a43bd
bump(*): go mod tidy|vendor
sallyom Feb 16, 2020
8a9e90d
remove initCSITests
sallyom Feb 16, 2020
d3a24de
update Dockerfile
sallyom Feb 16, 2020
1cfa27b
add origin/examples
sallyom Feb 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.13 AS builder
WORKDIR /go/src/github.com/openshift/extended-platform-tests
WORKDIR /go/src/github.com/openshift/openshift-tests
COPY . .
RUN make build WHAT=cmd/extended-platform-tests && \
mkdir -p /tmp/build && \
cp /go/src/github.com/openshift/extended-platform-tests/extended-platform-tests /tmp/build/extended-platform-tests
cp /go/src/github.com/openshift/openshift-tests/extended-platform-tests /tmp/build/extended-platform-tests

FROM registry.svc.ci.openshift.org/ocp/4.3:cli
FROM registry.svc.ci.openshift.org/ocp/4.4:tests-kubernetes AS builder1
RUN mkdir -p /tmp/build && \
cp /usr/bin/openshift-tests-kubernetes /tmp/build/openshift-tests-kubernetes

# this is temporary, remove once we transition from openshift-tests binary to openshift-tests-kubernetes,extended-platorm-tests
FROM registry.svc.ci.openshift.org/ocp/4.4:tests AS builder2
RUN mkdir -p /tmp/build && \
cp /usr/bin/openshift-tests /tmp/build/openshift-tests

FROM registry.svc.ci.openshift.org/ocp/4.4:cli
COPY --from=builder /tmp/build/extended-platform-tests /usr/bin/
COPY --from=builder1 /tmp/build/openshift-tests-kubernetes /usr/bin/
# this will be removed once transition from openshift-tests binary to openshift-tests-kubernetes,extended-platform-tests
COPY --from=builder2 /tmp/build/openshift-tests /usr/bin/
LABEL io.k8s.display-name="OpenShift Extended Platform Tests" \
io.k8s.description="OpenShift is a platform for developing, building, and deploying containerized applications." \
io.openshift.tags="openshift,tests,extended-platform"
61 changes: 0 additions & 61 deletions cmd/extended-platform-tests/csi.go

This file was deleted.

3 changes: 2 additions & 1 deletion cmd/extended-platform-tests/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/openshift/openshift-tests/pkg/test/ginkgo"

_ "github.com/openshift/openshift-tests/test/extended"
_ "github.com/openshift/openshift-tests/test/extended/util/annotate/generated"
)

// staticSuites are all known test suites this binary should run
Expand Down Expand Up @@ -140,7 +141,7 @@ var staticSuites = []*ginkgo.TestSuite{
See https://github.com/kubernetes/kubernetes/blob/master/test/e2e/storage/external/README.md for required format of the files.
`),
Matches: func(name string) bool {
return strings.Contains(name, "[Suite:openshift/csi") && !strings.Contains(name, "[Disruptive]")
return strings.Contains(name, "External Storage [Driver:") && !strings.Contains(name, "[Disruptive]")
},
},
{
Expand Down
173 changes: 19 additions & 154 deletions cmd/extended-platform-tests/openshift-tests.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"encoding/json"
"flag"
goflag "flag"
"fmt"
Expand All @@ -10,27 +9,17 @@ import (
"os"
"time"

"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

utilflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/logs"
"k8s.io/klog"
"k8s.io/kubectl/pkg/util/templates"
reale2e "k8s.io/kubernetes/test/e2e"
e2e "k8s.io/kubernetes/test/e2e/framework"

"github.com/openshift/library-go/pkg/serviceability"
"github.com/openshift/openshift-tests/pkg/monitor"
testginkgo "github.com/openshift/openshift-tests/pkg/test/ginkgo"
exutil "github.com/openshift/openshift-tests/test/extended/util"
exutilcloud "github.com/openshift/openshift-tests/test/extended/util/cloud"

// these are loading important global flags that we need to get and set
_ "k8s.io/kubernetes/test/e2e"
_ "k8s.io/kubernetes/test/e2e/lifecycle"
)

func main() {
Expand All @@ -54,7 +43,6 @@ func main() {

root.AddCommand(
newRunCommand(),
newRunUpgradeCommand(),
newRunTestCommand(),
newRunMonitorCommand(),
)
Expand Down Expand Up @@ -122,83 +110,21 @@ func newRunCommand() *cobra.Command {
SilenceErrors: true,
RunE: func(cmd *cobra.Command, args []string) error {
return mirrorToFile(opt, func() error {
if err := initProvider(opt.Provider, opt.DryRun); err != nil {
config, err := decodeProvider(opt.Provider, opt.DryRun, true)
if err != nil {
return err
}

e2e.AfterReadingAllFlags(exutil.TestContext)
e2e.TestContext.DumpLogsOnFailure = true
exutil.TestContext.DumpLogsOnFailure = true
return opt.Run(args)
})
},
}
bindOptions(opt, cmd.Flags())
return cmd
}

func newRunUpgradeCommand() *cobra.Command {
opt := &testginkgo.Options{Suites: upgradeSuites}
upgradeOpt := &UpgradeOptions{}

cmd := &cobra.Command{
Use: "run-upgrade SUITE",
Short: "Run an upgrade suite",
Long: templates.LongDesc(`
Run an upgrade test suite against an OpenShift server

This command will run one of the following suites against a cluster identified by the current
KUBECONFIG file. See the suite description for more on what actions the suite will take.

If you specify the --dry-run argument, the actions the suite will take will be printed to the
output.

Supported options:

* abort-at=NUMBER - Set to a number between 0 and 100 to control the percent of operators
at which to stop the current upgrade and roll back to the current version.
* disrupt-reboot=POLICY - During upgrades, periodically reboot master nodes. If set to 'graceful'
the reboot will allow the node to shut down services in an orderly fashion. If set to 'force' the
machine will terminate immediately without clean shutdown.

`) + testginkgo.SuitesString(opt.Suites, "\n\nAvailable upgrade suites:\n\n"),

SilenceUsage: true,
SilenceErrors: true,
RunE: func(cmd *cobra.Command, args []string) error {
return mirrorToFile(opt, func() error {
if len(upgradeOpt.ToImage) == 0 {
return fmt.Errorf("--to-image must be specified to run an upgrade test")
}

if len(args) > 0 {
for _, suite := range opt.Suites {
if suite.Name == args[0] {
upgradeOpt.Suite = suite.Name
upgradeOpt.JUnitDir = opt.JUnitDir
value := upgradeOpt.ToEnv()
if err := initUpgrade(value); err != nil {
return err
}
opt.SuiteOptions = value
break
}
}
}

if err := initProvider(opt.Provider, opt.DryRun); err != nil {
opt.Provider = config.ToJSONString()
matchFn, err := initializeTestFramework(exutil.TestContext, config, opt.DryRun)
if err != nil {
return err
}
e2e.AfterReadingAllFlags(exutil.TestContext)
e2e.TestContext.DumpLogsOnFailure = true
exutil.TestContext.DumpLogsOnFailure = true
opt.MatchFn = matchFn
return opt.Run(args)
})
},
}

bindOptions(opt, cmd.Flags())
bindUpgradeOptions(upgradeOpt, cmd.Flags())
return cmd
}

Expand All @@ -221,15 +147,14 @@ func newRunTestCommand() *cobra.Command {
SilenceUsage: true,
SilenceErrors: true,
RunE: func(cmd *cobra.Command, args []string) error {
if err := initProvider(os.Getenv("TEST_PROVIDER"), testOpt.DryRun); err != nil {
config, err := decodeProvider(os.Getenv("TEST_PROVIDER"), testOpt.DryRun, false)
if err != nil {
return err
}
if err := initUpgrade(os.Getenv("TEST_SUITE_OPTIONS")); err != nil {
if _, err := initializeTestFramework(exutil.TestContext, config, testOpt.DryRun); err != nil {
return err
}
e2e.AfterReadingAllFlags(exutil.TestContext)
e2e.TestContext.DumpLogsOnFailure = true
exutil.TestContext.DumpLogsOnFailure = true

return testOpt.Run(args)
},
}
Expand All @@ -241,23 +166,28 @@ func newRunTestCommand() *cobra.Command {
// any error returned from fn. The function returns fn() or any error encountered while
// attempting to open the file.
func mirrorToFile(opt *testginkgo.Options, fn func() error) error {
if opt.Out == nil {
opt.Out = os.Stdout
}
if opt.ErrOut == nil {
opt.ErrOut = os.Stderr
}
if len(opt.OutFile) == 0 {
opt.Out, opt.ErrOut = os.Stdout, os.Stderr
return fn()
}

f, err := os.OpenFile(opt.OutFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0640)
if err != nil {
return err
}
opt.Out = io.MultiWriter(os.Stdout, f)
opt.ErrOut = io.MultiWriter(os.Stderr, f)
opt.Out = io.MultiWriter(opt.Out, f)
opt.ErrOut = io.MultiWriter(opt.ErrOut, f)
exitErr := fn()
if exitErr != nil {
fmt.Fprintf(f, "error: %s", exitErr)
}
if err := f.Close(); err != nil {
fmt.Fprintf(os.Stderr, "error: Unable to close output file\n")
fmt.Fprintf(opt.ErrOut, "error: Unable to close output file\n")
}
return exitErr
}
Expand All @@ -274,68 +204,3 @@ func bindOptions(opt *testginkgo.Options, flags *pflag.FlagSet) {
flags.DurationVar(&opt.Timeout, "timeout", opt.Timeout, "Set the maximum time a test can run before being aborted. This is read from the suite by default, but will be 10 minutes otherwise.")
flags.BoolVar(&opt.IncludeSuccessOutput, "include-success", opt.IncludeSuccessOutput, "Print output from successful tests.")
}

func initProvider(provider string, dryRun bool) error {
// record the exit error to the output file
if err := decodeProviderTo(provider, exutil.TestContext, dryRun); err != nil {
return err
}
exutil.TestContext.AllowedNotReadyNodes = 100
exutil.TestContext.MaxNodesToGather = 0
reale2e.SetViperConfig(os.Getenv("VIPERCONFIG"))

if err := initCSITests(dryRun); err != nil {
return err
}

exutil.AnnotateTestSuite()
err := exutil.InitTest(dryRun)
gomega.RegisterFailHandler(ginkgo.Fail)

// TODO: infer SSH keys from the cluster
return err
}

func decodeProviderTo(provider string, testContext *e2e.TestContextType, dryRun bool) error {
switch provider {
case "":
if _, ok := os.LookupEnv("KUBE_SSH_USER"); ok {
if _, ok := os.LookupEnv("LOCAL_SSH_KEY"); ok {
testContext.Provider = "local"
break
}
}
if dryRun {
break
}
fallthrough

case "azure", "aws", "gce", "vsphere":
provider, cfg, err := exutilcloud.LoadConfig()
if err != nil {
return err
}
if cfg != nil {
testContext.Provider = provider
testContext.CloudConfig = *cfg
}

default:
var providerInfo struct{ Type string }
if err := json.Unmarshal([]byte(provider), &providerInfo); err != nil {
return fmt.Errorf("provider must be a JSON object with the 'type' key at a minimum: %v", err)
}
if len(providerInfo.Type) == 0 {
return fmt.Errorf("provider must be a JSON object with the 'type' key")
}
testContext.Provider = providerInfo.Type
if err := json.Unmarshal([]byte(provider), &testContext.CloudConfig); err != nil {
return fmt.Errorf("provider must decode into the cloud config object: %v", err)
}
}
if len(testContext.Provider) == 0 {
testContext.Provider = "skeleton"
}
klog.V(2).Infof("Provider %s: %#v", testContext.Provider, testContext.CloudConfig)
return nil
}
Loading