You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flags.BoolVar(&TestContext.DeleteNamespaceOnFailure, "delete-namespace-on-failure", true, "If true, framework will delete test namespace on failure. Used only during test debugging.")
287
292
flags.IntVar(&TestContext.AllowedNotReadyNodes, "allowed-not-ready-nodes", 0, "If non-zero, framework will allow for that many non-ready nodes when checking for all ready nodes.")
288
293
289
-
flags.StringVar(&TestContext.Host, "host", "", fmt.Sprintf("The host, or apiserver, to connect to. Will default to %s if this argument and --kubeconfig are not set", defaultHost))
294
+
flags.StringVar(&TestContext.Host, "host", "", fmt.Sprintf("The host, or apiserver, to connect to. Will default to %s if this argument and --kubeconfig are not set.", defaultHost))
290
295
flags.StringVar(&TestContext.ReportPrefix, "report-prefix", "", "Optional prefix for JUnit XML reports. Default is empty, which doesn't prepend anything to the default name.")
291
296
flags.StringVar(&TestContext.ReportDir, "report-dir", "", "Path to the directory where the JUnit XML reports should be saved. Default is empty, which doesn't generate these reports.")
292
297
flags.Var(cliflag.NewMapStringBool(&TestContext.FeatureGates), "feature-gates", "A set of key=value pairs that describe feature gates for alpha/experimental features.")
Copy file name to clipboardExpand all lines: test/e2e_node/e2e_node_suite_test.go
+16-9Lines changed: 16 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -56,18 +56,21 @@ import (
56
56
"k8s.io/klog/v2"
57
57
)
58
58
59
-
vare2es*services.E2EServices
60
-
61
-
// TODO(random-liu): Change the following modes to sub-command.
62
-
varrunServicesMode=flag.Bool("run-services-mode", false, "If true, only run services (etcd, apiserver) in current process, and not run test.")
63
-
varrunKubeletMode=flag.Bool("run-kubelet-mode", false, "If true, only start kubelet, and not run test.")
64
-
varsystemValidateMode=flag.Bool("system-validate-mode", false, "If true, only run system validation in current process, and not run test.")
65
-
varsystemSpecFile=flag.String("system-spec-file", "", "The name of the system spec file that will be used for node conformance test. If it's unspecified or empty, the default system spec (system.DefaultSysSpec) will be used.")
59
+
var (
60
+
e2es*services.E2EServices
61
+
62
+
// TODO(random-liu): Change the following modes to sub-command.
63
+
runServicesMode=flag.Bool("run-services-mode", false, "If true, only run services (etcd, apiserver) in current process, and not run test.")
64
+
runKubeletMode=flag.Bool("run-kubelet-mode", false, "If true, only start kubelet, and not run test.")
65
+
systemValidateMode=flag.Bool("system-validate-mode", false, "If true, only run system validation in current process, and not run test.")
66
+
systemSpecFile=flag.String("system-spec-file", "", "The name of the system spec file that will be used for node conformance test. If it's unspecified or empty, the default system spec (system.DefaultSysSpec) will be used.")
67
+
)
66
68
67
69
// registerNodeFlags registers flags specific to the node e2e test suite.
68
70
funcregisterNodeFlags(flags*flag.FlagSet) {
69
71
// Mark the test as node e2e when node flags are api.Registry.
70
72
framework.TestContext.NodeE2E=true
73
+
flags.StringVar(&framework.TestContext.BearerToken, "bearer-token", "", "The bearer token to authenticate with. If not specified, it would be a random token. Currently this token is only used in node e2e tests.")
71
74
flags.StringVar(&framework.TestContext.NodeName, "node-name", "", "Name of the node to run tests on.")
72
75
// TODO(random-liu): Move kubelet start logic out of the test.
73
76
// TODO(random-liu): Move log fetch logic out of the test.
@@ -205,8 +208,12 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
205
208
// Reference common test to make the import valid.
206
209
commontest.CurrentSuite=commontest.NodeE2E
207
210
208
-
returnnil
209
-
}, func([]byte) {
211
+
// ginkgo would spawn multiple processes to run tests.
212
+
// Since the bearer token is generated randomly at run time,
213
+
// we need to distribute the bearer token to other processes to make them use the same token.
214
+
return []byte(framework.TestContext.BearerToken)
215
+
}, func(token []byte) {
216
+
framework.TestContext.BearerToken=string(token)
210
217
// update test context with node configuration.
211
218
gomega.Expect(updateTestContext()).To(gomega.Succeed(), "update test context with node config.")
0 commit comments