Commit Graph

72 Commits

Author SHA1 Message Date
Patrick Ohly
30f93802a7 storage capacity: check pod events to finish negative tests faster
By creating CSIStorageCapacity objects in advance, we get the
FailedScheduling pod event if (and only if!) the test is expected to
fail because of insufficient or missing capacity. We can use that as
indicator that waiting for pod start can be stopped early. However,
because we might not get to see the event under load, we still need
the timeout.
2020-07-08 08:02:26 +02:00
Patrick Ohly
bd0579103a e2e storage: dead code removal and cleanup
Setting testParameters.scName had no effect because
StorageClassTest.StorageClassName isn't used anywhere. Instead, the
storage class name is generated dynamically.
2020-07-08 08:02:26 +02:00
Patrick Ohly
567ce87aee CSIStorageCapacity: E2E test with mock driver
We can create CSIStorageCapacity objects manually, therefore we don't
need the updated external-provisioner for these tests.
2020-07-08 08:02:26 +02:00
Kubernetes Prow Robot
0e8a2d2244
Merge pull request #90793 from pohly/flaky-mount-volume-calls
mock e2e test: reduce flakiness by not testing all calls
2020-05-19 15:22:19 -07:00
Hemant Kumar
da941d8d3e Create mock CSI driver resources in different namespace 2020-05-13 11:16:00 -04:00
Patrick Ohly
5aa3805a5f mock e2e test: reduce flakiness by not testing all calls
kubelet sometimes calls NodeStageVolume an NodePublishVolume too
often, which breaks this test and leads to flakiness. The test isn't
about that, so we can relax the checking and it still covers what it
was meant to cover.
2020-05-06 11:43:16 +02:00
Patrick Ohly
2ae6cf5984 mock tests: per-test timeout for ResourceExhausted
The timeout for the two loops inside the test itself are now bounded
by an upper limit for the duration of the entire test instead of
having their own, rather arbitrary timeouts.
2020-04-14 09:11:42 +02:00
Patrick Ohly
48f8e398fb mock tests: remove redundant wrapping of error
The "error waiting for expected CSI calls" is redundant because it's
immediately followed by checking that error with:

   framework.ExpectNoError(err, "while waiting for all CSI calls")
2020-04-07 13:09:31 +02:00
Patrick Ohly
2550051f3b mock tests: add timeout
The for loop that waited for the signal to delete pod had no timeout,
so if something went wrong, it would wait for the entire test suite to
time out.
2020-04-07 13:09:31 +02:00
Patrick Ohly
f117849582 mock tests: ResourceExhausted error handling in external-provisioner
The mock driver gets instructed to return a ResourceExhausted error
for the first CreateVolume invocation via the storage class
parameters.

How this should be handled depends on the situation: for normal
volumes, we just want external-scheduler to retry. For late binding,
we want to reschedule the pod. It also depends on topology support.
2020-04-07 13:09:31 +02:00
Patrick Ohly
367a23e4d9 mock tests: remove redundant retrieval of log output
The code became obsolete with the introduction of parseMockLogs
because that will retrieve the log itself. For debugging of a running
test the normal pod output logging is sufficient.
2020-04-07 13:07:09 +02:00
Patrick Ohly
d06589e4b6 mock tests: less verbose log output checking
parseMockLogs is called potentially multiple times while waiting for
output. Dumping all CSI calls each time is quite verbose and
repetitive. To verify what the driver has done already, the normal
capturing of the container log can be used instead:

csi-mockplugin-0/mock@127.0.0.1: gRPCCall: {"Method":"/csi.v1.Node/NodePublishVolume","Request"...
2020-04-07 13:07:09 +02:00
Patrick Ohly
981aae35dd mock tests: do not give up immediately for pod output errors
As seen in some test
runs (https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/89041),
retrieving output can fail with "the server rejected our request for
an unknown reason (get pods csi-mockplugin-0)".

If this truly an intermittent error, then the existing retry logic in
the callers can deal with this.
2020-04-06 15:03:44 +02:00
Jan Safranek
e23a26a380 Update to new javascript 2020-04-06 15:03:22 +02:00
Jan Safranek
a4f080861f Test NodeStage error cases
Especially related to "uncertain" global mounts. A large refactoring of CSI
mock tests were necessary:
- to be able to script the driver to return errors as required by the test
- to parse the CSI driver logs to check kubelet called the right CSI calls
2020-04-06 15:03:22 +02:00
Patrick Ohly
c9004e704d e2e/storage: check result of WaitForPersistentVolumeDeleted
When deleting fails, the tests should be considered as failed,
too. Ignoring the error caused a wrong return code in the CSI mock
driver to go unnoticed (see
https://github.com/kubernetes-csi/csi-test/pull/250). The v3.1.0
release of the CSI mock driver fixes that.
2020-03-26 13:22:04 +01:00
Kenichi Omichi
2158989d6f Move WaitForPersistentVolumeDeleted() to e2epv
The function is for persistent volumes and it doesn't have any
reason why it stays in core test framework. So this moves the
function into e2epv package for reducing e2e/framework/util.go
code.
2020-03-24 22:54:07 +00:00
Christian Huffman
c6fd25d100 Updated CSIDriver references 2020-03-06 08:21:26 -05:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Kubernetes Prow Robot
d6a5fa3bec
Merge pull request #88520 from bertinatto/fix-csi-mock-test-for-conformance
Don't rely on contents of optional Condition fields in CSI mock test
2020-02-27 20:20:38 -08:00
Patrick Ohly
d71829a1fc e2e: avoid setting NodeName for CSI driver deployments
We don't want to set the name directly because then starting the pod
can fail when the node is temporarily out of resources
(https://github.com/kubernetes/kubernetes/issues/87855).

For CSI driver deployments, we have three options:
- modify the pod spec with custom code, similar
  to how the NodeSelection utility code does it
- add variants of SetNodeSelection and SetNodeAffinity which
  work with a pod spec instead of a pod
- change their parameter from pod to pod spec and then use
  them also when patching a pod spec

The last approach is used here because it seems more general. There
might be other cases in the future where there's only a pod spec that
needs to be modified.
2020-02-26 10:33:29 +01:00
Fabio Bertinatto
34206a610a Don't rely on contents of optional Condition fields in CSI mock test
In order to promote the volume limits e2e test (from CSI Mock driver)
to Conformance, we can't rely on specific output of optional Condition
fields. Thus, this commit changes the test to only check the presence
of the right condition and verify that the optional fields are not empty.
2020-02-25 13:08:57 +01:00
Fabio Bertinatto
cd5cf567d8 Avoid adding labels to nodes in CSI mock driver
It's unnecessary to add labels to nodes because we're already
using NodeSelection to schedule pods on specific nodes.
2020-02-21 14:33:56 +01:00
Michelle Au
76a4a34dae Pass NodeSelection directly into e2e testsuites so that tests can use them more consistently
Change-Id: I99c8c1d8535a2a2319fbe8216b953c14a56f2763
2020-02-11 20:25:24 -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
Jonathan Basseri
99a015705b storage e2e: Add context to timeout errors
Many times an e2e test fails with an unexpected error,
"timed out waiting for the condition".

Useful information may be in the test logs, but debugging e2e test
failures will be much faster if we add context to errors when they
happen.

This change makes sure we add context to all errors returned from
helpers like wait.Poll().
2020-01-14 11:45:38 -08:00
Hemant Kumar
fca9963c24 Move publish and unpublish counting up in test
So as publish and unpublish are counted always
2020-01-06 16:50:55 -05:00
danielqsj
6596a14d39 add missing alias of api errors under test 2019-12-26 17:29:38 +08:00
Kubernetes Prow Robot
449fe0b1ba
Merge pull request #86397 from gnufied/fix-comparison-of-node-publish-unpublish
Expect NodeUnpublish calls when NodePublish is called
2019-12-20 09:09:32 -08:00
Hemant Kumar
d1fb0b57df Expect NodeUnpublish calls when NodePublish is called
While this is looser check than original check, I do not think
we can quite expect NodePublish and NodeUnpublish call counts to match

NodePublishvolume call count may not be same as NodeUnpublishVolume
call count because reconciler may have a mount operation queued up
while previous one is finishing. So, it is not unusual to have more than one
NodePublishVolume call for same pod+volume combination, similarly
unmount may also run more than once.
2019-12-19 14:28:27 -05:00
Hemant Kumar
03df6320e5 Wait for resizing condition 2019-12-18 17:50:29 -05:00
tanjunchen
f8e0c6bb41 test/e2e/storage : use framework.Equal() replace gomega.Expect(...).To(gomega.BeTrue(),...) 2019-12-11 16:25:26 +08:00
SataQiu
27d645dc5b fix staticcheck failures of test/e2e/storage 2019-12-07 21:32:11 +08:00
Michelle Au
2d467ed9d8 Update tests to use v1.CSINode 2019-10-28 13:41:13 -07:00
WanLinghao
a6f5d99409 Refactor and clean up e2e framework utils. This patch handles test/e2e/framework/pv_util.go file 2019-09-18 17:57:13 +08:00
carlory
910bd000ff use log functions of core framework in the 'test/e2e/storage/*' 2019-09-06 10:26:16 +08:00
Kubernetes Prow Robot
cd9519fe95
Merge pull request #82004 from pohly/ephemeral-beta
ephemeral inline CSI volumes as beta
2019-08-29 09:30:25 -07:00
Patrick Ohly
55334fb9e9 e2e storage: check NodeUnpublishVolume in csi-mock tests
Once we have deleted the pod and the volume, we want to be sure that
NodeUnpublishVolume was called for it. The main motivation was to
check this for inline ephemeral volumes, but the same additional check
also makes sense for other volumes.
2019-08-28 12:20:54 +02:00
Kubernetes Prow Robot
dccd28269a
Merge pull request #81467 from bertinatto/e2e_volume_expand
Graduate Volume Expansion to Beta + e2e tests
2019-08-28 01:37:25 -07:00
Patrick Ohly
482a900e83 storage: make CSIInlineVolume a beta feature
The feature is complete and supported by an increasing number of CSI
drivers, but before it can be really used, it should be moved out of
alpha into beta.
2019-08-28 05:32:44 +02:00
alejandrox1
7c161d6a5f Refactoring pod related functions from pv_util to pod pkg
Moving pod related functions from e2e/framework/pv_util.go to
e2e/framework/pod in order to allow refactoring of pv_util.go into its
own package.

Signed-off-by: alejandrox1 <alarcj137@gmail.com>
2019-08-27 12:27:45 -04:00
Fabio Bertinatto
73f31afd5d Graduate volume expansion to beta 2019-08-27 17:33:41 +02:00
Matthew Wong
b125bdda20 Don't overwrite PVC with nil/empty object returned by failed Update 2019-08-22 17:03:06 -07:00
Kubernetes Prow Robot
a3750501b0
Merge pull request #79983 from pohly/persistent-and-ephemeral-csi-volumes
persistent and ephemeral csi volumes
2019-07-25 16:01:54 -07:00
Patrick Ohly
608b0e7097 e2e storage: csi-mock tests for ephemeral inline volumes
The PodInfo tests can be extended to also cover the new
csi.storage.k8s.io/ephemeral flag. However, the presence of that flag
depends on whether inline volume support is enabled, so tests that run
with and without the feature have to detect that at runtime.

Other tests have a feature tag and thus can assume that they only run
when that feature is enabled. However, we need a newer csi-mock driver
before we can actually ask it to publish an ephemeral inline volume.
2019-07-25 16:45:46 +02:00
David Zhu
e194cf24cc Dedupe all Make PVC API object functions into the one MakePersistentVolumeClaim to rule them all 2019-07-23 12:59:00 -07:00
Masaki Kimura
ea4f4c8432 Move volume_expand tests to storage e2e testsuites 2019-07-11 18:49:49 +00:00
draveness
4c2e77a53e feat: use framework.ExpectEqual in storage e2e test 2019-07-04 22:24:29 +08:00
Fabio Bertinatto
33c8bacd41 Update nodeinfomanager to store volume limits in CSINode 2019-06-25 16:30:54 +02:00