Commit Graph

39 Commits

Author SHA1 Message Date
Davanum Srinivas
be42dcfd73
re-organize remote e2e test to be pluggable
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-03-13 12:33:47 -04:00
David Porter
c5a1f0188b
test: Add node e2e test to verify static pod termination
Add node e2e test to verify that static pods can be started after a
previous static pod with the same config temporarily failed termination.

The scenario is:

1. Static pod is started
2. Static pod is deleted
3. Static pod termination fails (internally `syncTerminatedPod` fails)
4. At later time, pod termination should succeed
5. New static pod with the same config is (re)-added
6. New static pod is expected to start successfully

To repro this scenario, setup a pod using a NFS mount. The NFS server is
stopped which will result in volumes failing to unmount and
`syncTerminatedPod` to fail. The NFS server is later started, allowing
the volume to unmount successfully.

xref:

1. https://github.com/kubernetes/kubernetes/pull/113145#issuecomment-1289587988
2. https://github.com/kubernetes/kubernetes/pull/113065
3. https://github.com/kubernetes/kubernetes/pull/113093

Signed-off-by: David Porter <david@porter.me>
2023-03-03 10:00:48 -06:00
David Porter
e9ecdf3534 test: Emit ginkgo log for each node e2e
When running multiple node e2e with multiple machine images, the tests
are run separately for each node. The final build log has all of the
results for each of the hosts combined together which make debugging the
log difficult. To make it easier, emit a log for each host that was run.
This log will be written to the results directory and uploaded as an
artifact in prow jobs.

Signed-off-by: David Porter <david@porter.me>
2023-02-28 00:21:34 -08:00
Patrick Ohly
136f89dfc5 e2e: use error wrapping with %w
The recently introduced failure handling in ExpectNoError depends on error
wrapping: if an error prefix gets added with `fmt.Errorf("foo: %v", err)`, then
ExpectNoError cannot detect that the root cause is an assertion failure and
then will add another useless "unexpected error" prefix and will not dump the
additional failure information (currently the backtrace inside the E2E
framework).

Instead of manually deciding on a case-by-case basis where %w is needed, all
error wrapping was updated automatically with

    sed -i "s/fmt.Errorf\(.*\): '*\(%s\|%v\)'*\",\(.* err)\)/fmt.Errorf\1: %w\",\3/" $(git grep -l 'fmt.Errorf' test/e2e*)

This may be unnecessary in some cases, but it's not wrong.
2023-02-06 15:39:13 +01:00
Antonio Ojea
7f5ae1c0c1
Revert "e2e: wait for pods with gomega" 2023-02-06 12:08:22 +01:00
Patrick Ohly
222f655062 e2e: use error wrapping with %w
The recently introduced failure handling in ExpectNoError depends on error
wrapping: if an error prefix gets added with `fmt.Errorf("foo: %v", err)`, then
ExpectNoError cannot detect that the root cause is an assertion failure and
then will add another useless "unexpected error" prefix and will not dump the
additional failure information (currently the backtrace inside the E2E
framework).

Instead of manually deciding on a case-by-case basis where %w is needed, all
error wrapping was updated automatically with

    sed -i "s/fmt.Errorf\(.*\): '*\(%s\|%v\)'*\",\(.* err)\)/fmt.Errorf\1: %w\",\3/" $(git grep -l 'fmt.Errorf' test/e2e*)

This may be unnecessary in some cases, but it's not wrong.
2023-01-31 13:01:39 +01:00
Patrick Ohly
41619ace15 stop using deprecated klog flags
Some scripts and tools still relied on the deprecated flags, the ones
which are about to be removed.

This is intentionally not a complete removal of all those flags in the entire
repo. This would lead to much more code churn also in places where commands
still accept the flags because they use klog directly.
2022-09-04 21:02:43 +02:00
Aditi Sharma
51cd36cf80 prepend credential provider flags on ubuntu also 2022-03-24 14:08:41 +05:30
Andrew Sy Kim
a4b79590eb move cluster/gce/gci/credential-provider to test/e2e_node/plugins/gcp-credential-provider
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2022-03-23 10:30:02 -04:00
Andrew Sy Kim
ddeb1e1352 cluster/gce/gci/credential-provider: add barebones GCP credential provider for testing only
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Co-authored-by: Aditi Sharma <adi.sky17@gmail.com>
2022-03-23 10:30:01 -04:00
Andrew Sy Kim
f440a69c70 test/e2e_node: install and configure kubelet credential provider
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Co-authored-by: Aditi Sharma <adi.sky17@gmail.com>
2022-03-23 10:30:01 -04:00
Amim Knabben
0341e4c2f3 Enabling runtime config on E2E node tests 2021-03-08 15:45:06 -05:00
Harshal Patil
a4cd6f13c8 Add SELinux labels for kubelet on Fedora CoreOS
Signed-off-by: Harshal Patil <harpatil@redhat.com>
2020-10-06 14:53:47 +05:30
Amim Knabben
c39cf28ed3 Moving Kubelet kernel-memgc-notification to configuration file 2020-06-24 06:44:00 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
SataQiu
69aae3aa5a fix golint failures of test/e2e_node/remote 2019-11-29 18:11:55 +08:00
Davanum Srinivas
7b8c9acc09
remove unused code
Change-Id: If821920ec8872e326b7d85437ad8d2620807799d
2019-04-19 08:36:31 -04:00
Zhen Wang
6df207bdaa allows configuring NPD image version in node e2e test and fix the test 2019-02-26 21:29:50 -08:00
Dmitry Rozhkov
43fce8d6e4 e2e-node-tests: fix path to system specs
e2e-node tests may use custom system specs for validating nodes to
conform the specs. The functionality is switched on when the tests
are run with this command:

    make SYSTEM_SPEC_NAME=gke test-e2e-node

Currently the command fails with the error:

    F1228 16:12:41.568836   34514 e2e_node_suite_test.go:106] Failed to load system spec: open /home/rojkov/go/src/k8s.io/kubernetes/k8s.io/kubernetes/cmd/kubeadm/app/util/system/specs/gke.yaml: no such file or directory

Move the spec file under `test/e2e_node/system/specs` and introduce a single
public constant referring the file to use instead of multiple private constants.
2019-01-10 10:37:55 +02:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Yuanbin.Chen
f2eee3fe2a Fix kubeadm checks import error
kubeadm checks package import path exist "kubernetes/test",
So change the import path.

  * move "k8s.io/kubernetes/test/e2e_node/system" directory file
    to "k8s.io/kubernetes/cmd/kubeadm/app/util/system"
  * change system package import path
  * remove "k8s.io/kubernetes/test/e2e_node/system" directory

Issues report link:
https://github.com/kubernetes/kubeadm/issues/976

Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-07-13 14:27:46 +08:00
liz
1ec02b1cd5
Move path management from e2e_node to common test/utils directory
enables reuse of these methods for other e2e tests
2018-04-27 11:12:10 -04:00
Di Xu
48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Mike Danese
bef68f7dbc cluster: build gci mounter like other go binaries 2017-10-30 13:56:09 -07:00
Random-Liu
6d132e8e18 Add extra log and node env support.
Signed-off-by: Random-Liu <taotaotheripper@gmail.com>
2017-10-10 18:07:08 -07:00
Yang Guo
1fb12b84dd Allow passing image description from e2e node test config 2017-08-14 17:11:05 -07:00
Yang Guo
78f04e2abf Add node e2e tests for GKE environment 2017-07-23 20:59:11 -07:00
Yang Guo
22c9e23202 Supports customized system spec in the node conformance test and creates the GKE system spec 2017-07-14 09:39:19 -07:00
Yang Guo
b17c6a1769 Add test image name to the OS image field of the perf metrics 2017-07-12 14:51:45 -07:00
Yang Guo
50d49d9c51 Enables memcg notification in cluster/node e2e tests 2017-06-26 11:40:22 -07:00
Michael Taufen
abb5c3fd5a Fix flag formatting errors in the node tests
There were three problems:
- Lack of a trailing space after prepending flags.
- Passing multiple flags in a string to --kubelet-flags seems to confuse
the flag parser; it stops parsing ALL flags as soon as it sees the
second kubelet flag. Fortunately, all instances of --kubelet-flags are
combined together, so we can just pass two of those.
- --feature-gates should be passed to the test framework, which then
forwards it to the kubelet, instead of using --kubelet-flags.

This hopefully fixes the dynamic config test failures on COS, which
started after #45602.
2017-05-11 11:28:49 -07:00
David Ashpole
0b1e45c5ff enable memcg on all testing 2017-05-10 11:38:26 -07:00
Kubernetes Submit Queue
8ab63dd9ea Merge pull request #42740 from mtaufen/tarball-cleanup
Automatic merge from submit-queue (batch tested with PRs 42740, 44980, 45039, 41627, 45044)

Cleanup some of the tarball producing code for e2e node tests

This is some e2e node cleanup work I found sitting in a local branch while deleting old local git branches. It looks like it's still useful.
2017-04-27 13:27:00 -07:00
Daniel Nardo
4e458ce001 Updates e2e_node test to allow both kubenet and cni to be specified for the network plugin.
This adds a simple CNI configuration which is added to the node during test setup.
This also modifies the default flags in services/kubelet.go to specify the "cni-bin-dir"
and the "cni-conf-dir" and removes the "network-plugin-dir" flag.  This leaves the default
network plugin to kubenet.
2017-04-13 09:57:46 -07:00
Michael Taufen
e6321c7440 Cleanup some of the tarball producing code 2017-04-10 07:09:31 -07:00
Michael Taufen
924ec4711b Prep node_e2e for GCI to COS name change 2017-01-23 15:00:39 -08:00
Random-Liu
02e96df55c Update log level. 2016-12-13 19:08:55 -08:00
Random-Liu
bca5aea5ba Refactor RunRemote to support TestSuite interface. 2016-12-13 19:08:55 -08:00
Random-Liu
99dc80ccc2 Add TestSuite interface and update the CreateTestArchive function. 2016-12-13 19:08:55 -08:00