File tree Expand file tree Collapse file tree 3 files changed +616
-0
lines changed
cmd/openshift-tests/health-check Expand file tree Collapse file tree 3 files changed +616
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import (
2222 collectdiskcertificates "github.com/openshift/origin/pkg/cmd/openshift-tests/collect-disk-certificates"
2323 "github.com/openshift/origin/pkg/cmd/openshift-tests/dev"
2424 "github.com/openshift/origin/pkg/cmd/openshift-tests/disruption"
25+ cluster_health_check "github.com/openshift/origin/pkg/cmd/openshift-tests/health-check"
2526 "github.com/openshift/origin/pkg/cmd/openshift-tests/images"
2627 "github.com/openshift/origin/pkg/cmd/openshift-tests/list"
2728 "github.com/openshift/origin/pkg/cmd/openshift-tests/monitor"
@@ -100,6 +101,7 @@ func main() {
100101 monitor .NewMonitorCommand (ioStreams ),
101102 disruption .NewDisruptionCommand (ioStreams ),
102103 risk_analysis .NewTestFailureRiskAnalysisCommand (),
104+ cluster_health_check .NewTestFailureClusterHealthCheckCommand (),
103105 run_resource_watch .NewRunResourceWatchCommand (),
104106 timeline .NewTimelineCommand (ioStreams ),
105107 run_disruption .NewRunInClusterDisruptionMonitorCommand (ioStreams ),
Original file line number Diff line number Diff line change 1+ package healthcheckpkg
2+
3+ import (
4+ healthcheck "github.com/openshift/origin/pkg/health-check"
5+ "github.com/spf13/cobra"
6+ "k8s.io/kubectl/pkg/util/templates"
7+ )
8+
9+ func NewTestFailureClusterHealthCheckCommand () * cobra.Command {
10+ healthCheckOpts := & healthcheck.Options {}
11+
12+ cmd := & cobra.Command {
13+ Use : "health-check" ,
14+ Short : "Performs health check against the cluster" ,
15+ Long : templates .LongDesc (`
16+ Check cluster health, including:
17+ all machines should be in Running state;
18+ all nodes should be ready;
19+ ready node count should match or exceed running machine count;
20+ operators health ordered by dependency;
21+ ` ),
22+ RunE : func (cmd * cobra.Command , args []string ) error {
23+ return healthCheckOpts .Run ()
24+ },
25+ }
26+ cmd .Flags ().StringVar (& healthCheckOpts .JUnitDir ,
27+ "junit-dir" , healthCheckOpts .JUnitDir ,
28+ "The directory where test reports were written, and operators health file will be stored." )
29+
30+ return cmd
31+ }
You can’t perform that action at this time.
0 commit comments