Commit Graph

295 Commits

Author SHA1 Message Date
Aaron Crickenberger
357ad91d78 demote kubelet events test from Conformance
This test has been part of the Conformance suite since at least
Kubernetes 1.2 (2015-10-xx). Some years later, around 2018-10-xx, we
drafted a rigorous set of rules for tests to follow in order to be
eligible for promotion to Conformance. We explicitly disallowed any
tests that check for specific Events, since they are not an API, and we
make no guarantees about their contents nor their delivery.

Unfortunately, we neglected to go through the existing corpus of
Conformance tests with a fine-toothed comb after drafting these rules.
The very nature of what this test is attempting to exercise and verify
is specific Events, and their delivery, thus making it ineligible for
Conformance. We should have caught and demoted this test back then.

Better late than never?
2021-11-17 15:36:30 -08:00
Antonio Ojea
d32b437b06 bump e2e period to wait for events 2021-11-17 23:46:52 +01:00
Danielle Lancashire
1f04f4ecbd test/e2e/node: Add endocrimes as reviewer 2021-11-17 15:43:41 +01:00
Nikhil Sharma
0316542704 Changed code to improve output for files under test/e2e/node 2021-11-04 20:09:59 +05:30
Tim Hockin
11a25bfeb6
De-share the Handler struct in core API (#105979)
* De-share the Handler struct in core API

An upcoming PR adds a handler that only applies on one of these paths.
Having fields that don't work seems bad.

This never should have been shared.  Lifecycle hooks are like a "write"
while probes are more like a "read". HTTPGet and TCPSocket don't really
make sense as lifecycle hooks (but I can't take that back). When we add
gRPC, it is EXPLICITLY a health check (defined by gRPC) not an arbitrary
RPC - so a probe makes sense but a hook does not.

In the future I can also see adding lifecycle hooks that don't make
sense as probes.  E.g. 'sleep' is a common lifecycle request. The only
option is `exec`, which requires having a sleep binary in your image.

* Run update scripts
2021-10-29 13:15:11 -07:00
David Porter
d28db6ee0c Support cgroupv2 in node problem detector test 2021-10-18 19:50:45 -07:00
Elana Hashman
f9a827b895
Fix bugs in e2e pod test
- Update test to account for late synced statuses
- Terminated containers are not running
- Add missing format values to test logline
2021-10-05 11:51:12 -07:00
David Porter
4b056a615a Skip runtimeclass test unless provider GCE
This test case requires special test-handler setup which is only done
for gce clusters created by kube-up scripts. Let's skip the test when
run under other providers.
2021-09-14 13:23:09 -07:00
Kubernetes Prow Robot
6b7c0cb386
Merge pull request #104048 from lizhuqi/fix-npd-test
Remove AUFSUmountHung from NPD test
2021-08-10 17:40:46 -07:00
Kubernetes Prow Robot
3670029b3d
Merge pull request #103640 from saschagrunert/crictl-host-local-test
Make crictl tests host local
2021-08-06 07:33:19 -07:00
Sergey Kanzhelev
023f6a90db Add SergeyKanzhelev to node e2e test approvers 2021-08-05 21:32:55 +00:00
Elana Hashman
ac076838c8
Add ehashman to node e2e test approvers
List of files raised by matthyx in SIG Node during the 2021-08-03
meeting.
2021-08-03 10:48:06 -07:00
Julie Qi
c35502ad4b Remove AUFSUmountHung from NPD test 2021-08-02 11:37:30 -07:00
Sascha Grunert
8ad83fd685
Make crictl tests host local
We now use a host local exec instead of SSH commands to simplify the
test and make the result more robust.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-07-21 16:46:37 +02:00
Sascha Grunert
c1bac40880
Fix SIG Node SSH e2e test
This assumes that SSH via bastion works if the `KUBE_SSH_BASTION`
environment variable is set, which is the case for
`pull-kubernetes-e2e-gce-correctness`.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-07-21 15:57:14 +02:00
Davanum Srinivas
07332ad398
fix ineffassign and varcheck
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-07-14 08:41:22 -04:00
Kubernetes Prow Robot
15ef9d42e3
Merge pull request #101866 from saschagrunert/ssh-hosts
e2e: test SSH port on NodeSSHHosts
2021-07-09 07:37:05 -07:00
Clayton Coleman
3eadd1a9ea
Keep pod worker running until pod is truly complete
A number of race conditions exist when pods are terminated early in
their lifecycle because components in the kubelet need to know "no
running containers" or "containers can't be started from now on" but
were relying on outdated state.

Only the pod worker knows whether containers are being started for
a given pod, which is required to know when a pod is "terminated"
(no running containers, none coming). Move that responsibility and
podKiller function into the pod workers, and have everything that
was killing the pod go into the UpdatePod loop. Split syncPod into
three phases - setup, terminate containers, and cleanup pod - and
have transitions between those methods be visible to other
components. After this change, to kill a pod you tell the pod worker
to UpdatePod({UpdateType: SyncPodKill, Pod: pod}).

Several places in the kubelet were incorrect about whether they
were handling terminating (should stop running, might have
containers) or terminated (no running containers) pods. The pod worker
exposes methods that allow other loops to know when to set up or tear
down resources based on the state of the pod - these methods remove
the possibility of race conditions by ensuring a single component is
responsible for knowing each pod's allowed state and other components
simply delegate to checking whether they are in the window by UID.

Removing containers now no longer blocks final pod deletion in the
API server and are handled as background cleanup. Node shutdown
no longer marks pods as failed as they can be restarted in the
next step.

See https://docs.google.com/document/d/1Pic5TPntdJnYfIpBeZndDelM-AbS4FN9H2GTLFhoJ04/edit# for details
2021-07-06 15:55:22 -04:00
Clayton Coleman
2d361d4306
e2e: Flag questionable durations in container status on termination
The e2e that create/deletes pods rapidly and verifies their status
was reporting a very long timing:

timings total=12.211347385s t=491ms run=2s execute=450402h8m25s

in a few scenarios. Add error checks that clarify when this happens
and why. Report p50/75/90/99 latencies on teardown as observed from
the test for baseline for future changes.
2021-05-24 11:48:42 -04:00
Kubernetes Prow Robot
1bd66f0301
Merge pull request #100859 from lack/relax_mount_propagation_e2e_test
Position e2e Mount Propagation test to be kubelet-specific
2021-05-18 09:44:49 -07:00
Sascha Grunert
9e372bffef
e2e: test SSH port on NodeSSHHosts
Before assuming that a certain host runs an SSH server, we now test its
`SSHPort` for connectivity. This means that the test `should be able to
run crictl on the node` can be now more failure proof by checking only
hosts where SSH actually runs. Beside that, we can also test all hosts
and not only the first one.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-05-11 08:32:09 +02:00
wangyx1992
fda7421f24 cleanup: replace x.Sub(time.Now()) with time.Until(x) in e2e test
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-23 11:27:12 +08:00
Jim Ramsay
050001d1d3 Position e2e Mount Propagation test to be kubelet-specific
This replaces the check of mount propagation to/from the host OS mount
namespace to a similar check about the mount namespace where kubelet is
running (which may or may not be the same mount namespace as the host
OS).

This addresses issue #100259
2021-04-13 12:03:08 -04:00
Kubernetes Prow Robot
b85313b6dd
Merge pull request #99853 from wojtek-t/cleanup_describe_17
Cleanup the remaining multi-owned sig-node tests
2021-03-08 19:23:44 -08:00
Jordan Liggitt
8bbb6704c1 Update flaky volume toleration regex to include projected volumes 2021-03-06 11:39:36 -05:00
wojtekt
ae8baefeff Cleanup the remaining multi-owned sig-node tests 2021-03-05 20:27:31 +01:00
wojtekt
f277e4d32a Remove nested SIGDescribe calls 2021-03-03 15:25:07 +01:00
Navid Shaikh
e61f790eac test/e2e: Move tests into test/e2e/node package
- assign sig-node ownership
 - Fix import aliases in test/e2e/node/examples.go
 - Fix merge conflicts in test/e2e/BUILD

Signed-off-by: Navid Shaikh <shaikhnavid14@gmail.com>
2021-03-02 10:05:53 +05:30
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Kubernetes Prow Robot
f2d5ee2d2d
Merge pull request #99508 from wojtek-t/cleanup_describe_10
Move node_recreate test to cloud/gcp directory
2021-02-26 18:06:38 -08:00
wojtekt
4b98a9f1e6 Move node_recreate test to cloud/gcp directory 2021-02-26 21:47:27 +01:00
wojtekt
cad9957f95 Remove KubeDescribe from SIGDescribe calls 2021-02-26 08:49:25 +01:00
wojtekt
8df355b80a Replace some nested KubeDescribe calls with ginkgo.Describe 2021-02-25 14:44:39 +01:00
Kubernetes Prow Robot
8f15f7cf5e
Merge pull request #99400 from wojtek-t/ttl_after_finished_test
Move TTLAfterFinished test to appropriate SIG
2021-02-24 08:53:02 -08:00
wojtekt
9bcb480574 Move TTLAfterFinished test to appropriate SIG 2021-02-24 16:09:20 +01:00
Mayank Kumar
2dfc7c3943 Promote RunAsGroup e2e test to Conformance 2021-02-18 21:21:29 -08:00
Kubernetes Prow Robot
82df435300
Merge pull request #99016 from wojtek-t/sig_describe
Minor refactor of test/e2e/common names
2021-02-18 10:03:04 -08:00
wojtekt
d5e5f14508 Fix NPD test to run it in private and large clusters 2021-02-18 08:07:22 +01:00
wojtekt
498441448c Minor refactor of test/e2e/common names 2021-02-15 08:16:01 +01:00
ravisantoshgudimetla
1304be0c89 Fix test failures 2020-11-25 20:16:07 +05:30
Sergey Kanzhelev
06da0e5e74 GA of RuntimeClass feature gate and API 2020-11-11 19:22:32 +00:00
Kubernetes Prow Robot
5a75f64315
Merge pull request #95046 from SergeyKanzhelev/runtimeClass
RuntimeHandler test - mark as serial instead of disruptive and provide non-serial alternative
2020-11-11 02:43:48 -08:00
Sergey Kanzhelev
9408c5d1e6 added new runtimeclass test and changed Disruptive to Serial 2020-11-10 20:31:34 +00:00
Mrunal Patel
b78be8446f Add mrunalp as node approver
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
2020-11-04 15:48:30 -08:00
Amim Knabben
b340bb5f95 Removing flaky tag from test 2020-10-14 21:00:24 -04:00
Kubernetes Prow Robot
5e44d8ebaf
Merge pull request #95015 from Jefftree/bdd-remove-dependency
Remove dependency on behaviors for conformance walk.go
2020-10-05 13:04:19 -07:00
Seth Jennings
b7c74338e8 test: e2e: fix race in pods test 2020-10-02 14:32:31 -05:00
Amim Knabben
68ce3cf3d4 Verify pod termination with E2E PreStop hook 2020-10-01 16:04:07 -04:00
Jefftree
fe972b8f2f Remove dependency on behaviors for conformance generation 2020-09-23 13:28:06 -07:00
Claudiu Belu
89eae73323 tests: Refactors agnhost image pod usage in tests
A previous commit created a few agnhost related functions that creates agnhost
pods / containers for general purposes.

Refactors tests to use those functions.
2020-09-22 13:09:49 -07:00
Marek Siarkowicz
7d309e0104 Move Kubelet Summary API to staging repo 2020-09-22 18:23:28 +02:00
David Ashpole
0ffc149ccc move dashpole to emeritus in kubelet 2020-09-16 11:52:35 -07:00
Kubernetes Prow Robot
4847c69ced
Merge pull request #91442 from saschagrunert/seccomp-ga-e2e
Update seccomp e2e test for GA
2020-09-08 04:53:58 -07:00
Kubernetes Prow Robot
48d5d204c3
Merge pull request #92614 from tnqn/onfailure-recreate
Don't create a new sandbox for pod with RestartPolicyOnFailure if all containers succeeded
2020-09-03 14:57:40 -07:00
Daniel Smith
75f835aa08 move port definitions to a common location 2020-09-02 10:48:25 -07:00
Javier Diaz-Montes
0f5a03195b Moving e2e tests to e2e_node directory 2020-08-28 12:54:12 -04:00
Javier Diaz-Montes
c74a772794 Adding label NodeAlphaFeature to include tests in Node Testgrid 2020-08-25 16:38:11 -04:00
Sascha Grunert
3bef0e40a6
Update seccomp e2e test for GA
We now execute the seccomp tests with `[LinuxOnly]` as described in the
appropriate KEP test plan:

https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/20190717-seccomp-ga.md#test-plan

The tests have been changed to used the new seccomp field within the
security context in replacement for the annotations.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-10 08:50:44 +02:00
Jefftree
ace97738e2 Update formatting of conformance comment 2020-07-29 20:50:44 -07:00
Quan Tian
b2b082f54f Don't create a new sandbox for pod with RestartPolicyOnFailure if all containers succeeded
The kubelet would attempt to create a new sandbox for a pod whose
RestartPolicy is OnFailure even after all container succeeded. It caused
unnecessary CRI and CNI calls, confusing logs and conflicts between the
routine that creates the new sandbox and the routine that kills the Pod.

This patch checks the containers to start and stops creating sandbox if
no container is supposed to start.
2020-07-07 22:49:48 +08:00
Seth Jennings
b1f91d33e7 add dashpole and sjenning to cmd/kubelet OWNERS 2020-07-02 14:20:41 -05:00
Kubernetes Prow Robot
b5dd76071e
Merge pull request #92271 from oomichi/move-gce-test
Move recreate_node.go to e2e/node
2020-06-19 21:52:11 -07:00
Kenichi Omichi
4163fd9420 Move recreate_node.go to e2e/node
e2e/framework is a place to keep common functions for e2e tests, and
it is not a place to keep e2e tests themself. recreate_node.go is e2e
test for node.
This moves recreate_node.go to e2e/node.
2020-06-19 02:40:17 +00:00
Javier Diaz-Montes
9743cda4a7 Adding Kubelet changes to enable SetHostnameAsFQDN feature
These changes allow to set FQDN as hostname of pods for pods
that set the new PodSpec field setHostnameAsFQDN to true. The PodSpec
new field was added in related PR.

This is PART2 (last) of the changes to enable KEP #1797 and addresses #91036
2020-06-14 21:26:27 -04:00
Ryan Phillips
d9d1fc6077 e2e pods: add missing pod and node name in the formatted log line 2020-06-11 14:50:27 -05:00
Kubernetes Prow Robot
f834c92ce1
Merge pull request #91632 from liggitt/ginkgo-recover-e2e
Defer ginkgo recovers
2020-06-01 16:24:14 -07:00
Jordan Liggitt
c9638d54d0 Defer ginkgo recovers 2020-06-01 11:02:41 -04:00
Jordan Liggitt
ee193bcd40 Add debugging and timeouts to pending pod e2e 2020-05-29 11:54:16 -04:00
Jefftree
ceb67482c4 link 2 pod conformance tests with behaviors 2020-05-18 23:35:25 -07:00
tanjunchen
3b5ea194ea test/e2e/framework : move AddOrUpdateTaintOnNode to subpackage node 2020-04-29 21:29:38 +08:00
tanjunchen
6532b40f21 move function RemoveTaintOffNode in test/e2e/framework/util.go to subpackage node 2020-04-08 09:59:44 +08:00
drfish
dfab6b637f Update .import-aliases for e2e test framework 2020-03-25 11:40:02 +08:00
Derek Carr
02e4ce6835 deflake grace period for pod deletion in node e2e 2020-03-23 15:23:54 -04:00
tanjunchen
bed22fbb44 WaitForPodReady is simply wrapper functions for e2epod package,
and they made an invalid dependency to sub e2e framework from the core framework.

So we can use e2epod.WaitTimeoutForPodReadyInNamespace to remove invalid dependency.

The main purpose of this pr is to handle the framework core package dependency subpackage pod.
2020-03-22 23:08:52 +08:00
Kenichi Omichi
2c8955fd4a Use e2epod.WaitForPodNameRunningInNamespace directly
WaitForPod*() are just wrapper functions for e2epod package, and they
made an invalid dependency to sub e2e framework from the core framework.
So this replaces WaitForPodRunning() with the e2epod function.
2020-03-17 00:13:14 +00:00
Clayton Coleman
d80981b657
test: Detect flakes caused by container teardown races on CRI
CRI returns a different reason than the dockershim, and we must also
catch the symptoms of https://github.com/kubernetes/kubernetes/issues/88766
in that environment.
2020-03-08 16:21:57 -04:00
Kubernetes Prow Robot
5708511499
Merge pull request #88708 from mikedanese/deleteopts
Migrate clientset metav1.DeleteOpts to pass-by-value
2020-03-05 23:09:23 -08:00
Kubernetes Prow Robot
f5df777d50
Merge pull request #88872 from smarterclayton/fix_flake
test: Properly detect container runtime flake in e2e test
2020-03-05 21:40:23 -08:00
Kubernetes Prow Robot
34c4407d34
Merge pull request #88152 from fengzixu/master
cleanup: move the test of TaintBasedEvictions features to sig-node
2020-03-05 20:03:43 -08:00
Mike Danese
aaf855c1e6 deref all calls to metav1.NewDeleteOptions that are passed to clients.
This is gross but because NewDeleteOptions is used by various parts of
storage that still pass around pointers, the return type can't be
changed without significant refactoring within the apiserver. I think
this would be good to cleanup, but I want to minimize apiserver side
changes as much as possible in the client signature refactor.
2020-03-05 14:59:46 -08:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Clayton Coleman
8c35e32a40
test: Properly detect container runtime flake in e2e test
The condition was not part of the message and so would not
match:

OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/var/lib/kubelet/pods/128aea1f-bde3-43d5-8b5f-dd86b9a5ef33/volumes/kubernetes.io~secret/default-token-v55hm\\\" to rootfs \\\"/var/lib/docker/overlay2/813487ba91d534ded546ae34f2a05e7d94c26bd015d356f9b2641522d8f0d6da/merged\\\" at \\\"/var/run/secrets/kubernetes.io/serviceaccount\\\" caused \\\"stat /var/lib/kubelet/pods/128aea1f-bde3-43d5-8b5f-dd86b9a5ef33/volumes/kubernetes.io~secret/default-token-v55hm: no such file or directory\\\"\"": unknown

Updated the check and regex.
2020-03-05 14:20:59 -05:00
Clayton Coleman
6d98b0a0f4
Test that an always-fail container can't report the pod Succeeded
The kubelet can race when a pod is deleted and report that a container succeeded
when it instead failed, and thus the pod is reported as succeeded. Create an e2e
test that demonstrates this failure.
2020-03-04 13:34:20 -05:00
fengzixu
076132e38a cleanup: move the test of TaintBasedEvictions features to sig-node
1. move the integration test of TaintBasedEvictions to test/integration/node
2. move the e2e test of TaintBasedEvictions e2e test/e2e/node
3. modify the conformance file to adapt the TaintBasedEviction test
2020-03-04 10:28:00 +09:00
Eric Ernst
e5760015d2 e2e-framework-node: add runtimeclass to dedup code
Similar functionality is required across e2e tests for RuntimeClass.
Let's create runtimeclass as part of the framework/node package.

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2020-02-20 15:58:52 -08:00
Kir Kolyshkin
70a2857998 test/e2e/node: fix selinux test failure
Commit 69a473be3 broke the test case (that was checking
that a file from a volume can't be read) by adding a
(wrong) assumption that error should be nil.

Fix the assumption (we do expect the error here).
Note that we were checking file contents before; now when
we check the error from read, checking the contents is
redundant.

The other issue with the test is SELinux should be in enforcing
mode for this to work, so let's check that first to avoid
false positives.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-02-17 09:46:59 -08:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Sakura
b9a586e382
Fix non-ascii characters in test/e2e/node/pods.go
Signed-off-by: Sakura <longfei.shang@daocloud.io>
2020-02-05 15:14:21 +08:00
Mike Danese
968adfa993 cleanup req.Context() and ResponseWrapper 2020-01-29 08:50:45 -08:00
Mike Danese
d55d6175f8 refactor 2020-01-29 08:50:45 -08:00
toyoda
0c12ae5240 Modify alias of e2e/framework/job to e2ejob 2020-01-17 10:56:05 +09:00
tanjunchen
8c481022c1 e2e/node/:Use e2eskipper package 2020-01-10 16:21:12 +08:00
Aaron Crickenberger
4d731d92bf Demote Delete Grace Period test to [Flaky]
This is currently the top flake against PRs, so I'm tagging it
as [Flaky]. Flaky tests can't be conformance tests, so I'm
removing it from [Conformance] as well until this is resolved.
2020-01-08 10:12:47 -08:00
Kubernetes Prow Robot
de3be348a6
Merge pull request #86640 from tanjunchen/move-code-test/e2e/framework/job
move funcs from test/e2e/framework/job to test/e2e/apps
2019-12-27 19:47:51 -08:00
tanjunchen
794a8668fa move funcs from test/e2e/framework/job to test/e2e/apps 2019-12-27 09:35:30 +08:00
danielqsj
fc738cbb1d unify alias of api errors under test 2019-12-26 16:40:45 +08:00
Kubernetes Prow Robot
6eb4e7c443
Merge pull request #86315 from liggitt/delete-grace-period-debug
Add debugging for delete grace period e2e flake
2019-12-19 00:38:10 -08:00
Jordan Liggitt
176c95ff3e Add debugging for delete grace period e2e flake 2019-12-16 14:15:19 -05:00
tanjunchen
f786cb07b7 test/e2e/: use framework.Equal() replace gomega.Expect(...).To(gomega.BeTrue()|BeFalse()) 2019-12-13 10:11:47 +08:00