Commit Graph

38 Commits

Author SHA1 Message Date
Roman Bednar
8567eafa02 add anti-capability to allow resize test skipping 2023-02-27 10:47:02 +01:00
Patrick Ohly
db394db398 e2e: move several timeouts from TestContext into TimeoutContext
This consolidates timeout handling. In the future, configuration of all
timeouts via a configuration file might get added. For now, the same three
legacy command line flags for the timeouts that get moved continue to be
supported.
2023-01-09 17:29:35 +01:00
Patrick Ohly
2f6c4f5eab e2e: use Ginkgo context
All code must use the context from Ginkgo when doing API calls or polling for a
change, otherwise the code would not return immediately when the test gets
aborted.
2022-12-16 20:14:04 +01:00
Kubernetes Prow Robot
0a08757181
Merge pull request #113128 from pohly/e2e-storage-cleanup
e2e storage: cleanup with context
2022-10-20 10:29:00 -07:00
Patrick Ohly
d8d3dc9476 e2e storage: eliminate explicit test driver cleanup
Cleanup can be handled inside the setup code with ginkgo.DeferCleanup. This
simplifies the code.
2022-10-20 13:56:59 +02:00
Jan Safranek
bda42b6b53 Add capability for tests with multiple PVs with the same VolumeHandle
Some CSI drivers do not like multiple PVs with the same VolumeHandle,
therefore make that tests optional.
2022-10-18 13:44:54 +02:00
Chris Henzie
f6d9c27722 e2e test for ReadWriteOncePod PV access mode
Adds two tests for the enforcement of the ReadWriteOncePod
PersistentVolume access mode.

1. Tests that when two Pods are scheduled that reference the same
   ReadWriteOncePod PVC, the latter-scheduled Pod will be marked
   unschedulable because the PVC is in-use.
2. Tests that when two Pods are scheduled on the same node (setting
   Pod.Spec.NodeName to bypass scheduling for the second Pod), the
   latter Pod will fail to start because the PVC is already mounted on
   the Node.

Included are changes to update the hostpath CSI driver to accept new CSI
access modes. Its sidecar containers are already at supported versions
for ReadWriteOncePod and don't need updating. The GCP PD CSI driver does
not yet support the new CSI access modes, but its sidecar containers are
at supported versions and so the feature will work.

To support ReadWriteOncePod, the following CSI sidecars must be updated
to these versions or greater:
 - csi-provisioner:v3.0.0+
 - csi-attacher:v3.3.0+
 - csi-resizer:v1.3.0+

For more details, see:
https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/2485-read-write-once-pod-pv-access-mode/README.md
2022-10-14 09:15:36 -07:00
Fabio Bertinatto
e13c9be88a e2e: use custom timeouts in GetSnapshotContentFromSnapshot() 2022-08-26 15:16:35 -03:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Dave Chen
857458cfa5 update ginkgo from v1 to v2 and gomega to 1.19.0
- update all the import statements
- run hack/pin-dependency.sh to change pinned dependency versions
- run hack/update-vendor.sh to update go.mod files and the vendor directory
- update the method signatures for custom reporters

Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-07-08 10:44:46 +08:00
apeltop
e530336b18 fix typos 2022-06-15 13:38:48 +09:00
Hemant Kumar
fb9db79d3f Enable volume expansion tests for generic ephemeral volumes 2022-05-23 21:58:34 -04:00
Kubernetes Prow Robot
094a33ad80
Merge pull request #109342 from bertinatto/custom-timeout-storage-e2e-cleanup
test/e2e/storage: replace hardcoded value with custom timeout in cleanup routine
2022-05-04 03:45:52 -07:00
Kubernetes Prow Robot
3739175e1f
Merge pull request #109580 from dobsonj/offline-expansion-test-flag
e2e: add storage capability for offline volume expansion
2022-05-04 02:34:29 -07:00
Jonathan Dobson
f369b1234a e2e: add storage capability for offline volume expansion 2022-04-21 14:49:18 -06:00
Fabio Bertinatto
5ccef5c25e test/e2e/storage: replace hardcoded value with custom timeout in cleanup routine 2022-04-06 14:25:40 -03:00
Patrick Ohly
c681ff2320 storage e2e: set fstype for CSI ephemeral inline volumes
This doesn't affect in-tree testing, but some out-of-tree usage of the
pre-defined test patterns with non-default fstype.
2022-04-04 10:09:43 +02:00
Cheng Xing
4836fd1510 Skip OnRootMismatch tests if the CSI driver supports VOLUME_MOUNT_GROUP. 2021-11-12 18:27:22 -08:00
David Eads
c8f87a6a24 retry PV create in e2e-test on API quota failure 2021-10-26 09:47:16 -04:00
Kubernetes Prow Robot
7fbb384e15
Merge pull request #105682 from pohly/generic-ephemeral-volume-raw-block
storage validation: accept generic ephemeral volumes as volume device
2021-10-22 18:04:50 -07:00
Patrick Ohly
5462d97e62 storage e2e: test snapshotting of generic ephemeral volumes
Conceptually, snapshots have to be taken while the pod and thus the volume
exist. Snapshotting has an issue where flushing of data is not guaranteed while
the volume is still staged on the node, so the test relied on deleting the pod
and checking for the volume to be unused. That part of the test cannot be done
for ephmeral volumes.
2021-10-19 14:01:21 +02:00
Patrick Ohly
a90a3c6a9c storage e2e: check raw block support for generic ephemeral volumes
This adds a new test pattern and uses it for the inline volume tests. Because
the kind of volume now varies more, validation of the mount or block device is
always done by the caller of TestEphemeral.
2021-10-19 13:30:32 +02:00
Mauricio Poppe
e89704dbb1 Copy VolumeSnapshotContent annotations in snapshottable.go test 2021-09-30 23:43:21 +00:00
lzj
7cf30d5690 fix/remove-errors-pkg 2021-06-24 16:09:59 +08:00
Kubernetes Prow Robot
cc7721362c
Merge pull request #102665 from gnufied/add-online-expansion-cap
Add explicit capability for online volume expansion
2021-06-08 08:33:36 -07:00
Hemant Kumar
95c8b02096 Add explicit capability for online volume expansion 2021-06-07 13:43:18 -04:00
Jan Safranek
28511e82ad Add e2e test for a volume + its clone used on the same node
CSI driver need to pass special mount opts to XFS filesystem to be able to
mount a volume + its clone or its restored snapshot on the same node. Add a
test to exhibit this behavior.

The test is optional for now, giving CSI drivers time to fix it.
2021-06-07 18:29:47 +02:00
Kubernetes Prow Robot
2eb6911e83
Merge pull request #94334 from RaunakShah/volume_provision_perf
Add e2e test to validate performance metrics of volume lifecycle operations
2021-03-24 23:47:29 -07:00
Patrick Ohly
d7a086ddd8 storage e2e: simplify CSIStorageCapacity test
We can support topology detection for all drivers with a single
topology key by allowing different nodes to have the same topology
value. This makes the test a bit more generic and its configuration
simpler.
2021-03-24 22:31:43 +01:00
shahra
34e4a5f22c Add e2e test to validate performance metrics of volume lifecycle operations.
This test currently validates latency and throughput of volume
provisioning against a high baseline.
2021-03-24 13:50:32 -07:00
Patrick Ohly
b9b5d13b6d storage e2e: verify CSIStorageCapacity publishing
Drivers need to opt into the new test. Depending on how the driver
describes its behavior, the check can be more specific. Currently it
distinguishes between getting any kind of information about the
storage class (i.e. assuming that capacity is not exhausted) and
getting one object per node (for local storage). Discovering nodes
only works for CSI drivers.

The immediate usage of this new test is for csi-driver-host-path with
the deployment for distributed provisioning and storage capacity
tracking. Periodic kubernetes-csi Prow and pre-merge jobs can run this
test.

The alternative would have been to write a test that manages the
deployment of the csi-driver-host-path driver itself, i.e. use the E2E
manifests. But that would have implied duplicating the
deployments (in-tree and in csi-driver-host-path) and then changing
kubernetes-csi Prow jobs to somehow run for in-tree driver definition
with newer components, something that currently isn't done. The test
then also wouldn't be applicable to out-of-tree driver deployments.

Yet another alternative would be to create a separate E2E test suite
either in csi-driver-host-path or external-provisioner. The advantage
of such an approach is that the test can be written exactly for the
expected behavior of a deployment and thus be more precise than the
generic version of the test in k/k. But this again wouldn't be
reusable for other drivers and also a lot of work to set up as no such
E2E test suite currently exists.
2021-03-24 18:18:27 +01:00
Patrick Ohly
25f4174148 testdata: drop the alpha EphemeralVolumeSource.ReadOnly field
This is the result of
   UPDATE_COMPATIBILITY_FIXTURE_DATA=true go test k8s.io/api
after removing the ReadOnly field from the API. The test data
for older releases must be updated because the current code
no longer supports that field.

The removal itself is okay because the struct was declared
as alpha.

Because EphemeralVolumeSource is embedded quite a lot, different types
are affected. Here is one example:

       --- FAIL: TestCompatibility/extensions.v1beta1.DaemonSet/v1.20.0 (0.04s)
            compatibility.go:476: json differs
            compatibility.go:477:   string{
                  	... // 12941 identical bytes
                  	0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, //  |               }|
                  	0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, //  |.              }|
                - 	0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // -|,.              |
                - 	0x22, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, // -|"readOnly": true|
                  	0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, //  |.            }. |
                  	0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, //  |         }.     |
                  	... // 31426 identical bytes
                  }

            compatibility.go:482: yaml differs
            compatibility.go:483:   string{
                  	... // 22893 identical bytes
                  	0x34, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x70, 0x68, 0x65, 0x6d, //  |4".        ephem|
                  	0x65, 0x72, 0x61, 0x6c, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, //  |eral:.          |
                - 	0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, 0x0a, 0x20, // -|readOnly: true. |
                - 	0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,                                           // -|         |
                  	0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x54, 0x65, 0x6d, 0x70, 0x6c, //  |volumeClaimTempl|
                  	0x61, 0x74, 0x65, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, //  |ate:.           |
                  	... // 5965 identical bytes
                  }

            compatibility.go:488: proto differs
            compatibility.go:490:   (
                  	"""
                  	... // 459 identical lines
                  	                }
                  	              }
                - 	              2: 1
                  	            }
                  	          }
                  	... // 1083 identical lines
                  	"""
                  )

            compatibility.go:506: wrote expected compatibility data... verify, commit, and rerun tests
2021-03-09 08:24:52 +01:00
Patrick Ohly
555d4a12bf generic ephemeral volumes: drop ReadOnly field
As discussed during the alpha review, the ReadOnly field is not really
needed because volume mounts can also be read-only. It's a historical
oddity that can be avoided for generic ephemeral volumes as part
of the promotion to beta.
2021-03-09 08:22:48 +01:00
wojtekt
ca333d7a7a Tag storage windows tests with [Feature:Windows] instead of [sig-windows] 2021-03-03 12:08:59 +01:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Manohar Reddy
a6ec62f76d add e2e tests for DeleteSnapshotsecrets 2021-02-04 10:46:00 +05:30
lala123912
165907f60a remove suffixes from generated StorageClasses and VolumeSnapshotClass 2020-12-14 16:48:41 +08:00
Jiawei Wang
356bea6c9f Add storage framework and address comments 2020-12-10 22:48:06 -08:00