Commit Graph

488 Commits

Author SHA1 Message Date
riya-singhal31
a7d259a334 e2e: add test for validation of kernelMountOption
Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-07-05 11:20:47 +00:00
riya-singhal31
330995751a e2e: add test for validation of fuseMountOptions
Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-07-05 11:20:47 +00:00
Rakshith R
54eeac212e e2e: add test cases for pv.Spec.MountOptions
Signed-off-by: Rakshith R <rar@redhat.com>
2023-06-19 09:51:40 +00:00
karthik-us
e4e373cd47 e2e: Make getConfigFile() generic
Update the getConfigFile() function to allow any file to be looked
at on the preferred location first and fall back to the alternate
location if it does not exist there.

Signed-off-by: karthik-us <ksubrahm@redhat.com>
2023-06-07 12:51:43 +00:00
karthik-us
6ac3a4dabc cleanup: Move common files to deploy folder
Few common files related to deployments were kept
in the examples folder initially. Moving them to
deploy folder and updating the relevant files.

Signed-off-by: karthik-us <ksubrahm@redhat.com>
2023-06-07 12:51:43 +00:00
riya-singhal31
b5e68c810e rbd: add unit test for ParseEncryptionOpts
Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-06-06 22:01:26 +00:00
riya-singhal31
e92edd09ef rbd: add e2e for encryption as false
Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-06-06 22:01:26 +00:00
Niels de Vos
439918c10d e2e: re-use context.Context for PollUntilContextTimeout() calls
There are many locations where a new context is created. These can be
reduced when subsequent calls re-use a previously created context
object.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-06-06 12:21:43 +00:00
Niels de Vos
2884b0dde7 rebase: replace deprecated PollImmediate() with `PollUntilContextTimeout()
Kubernetes 1.27 deprecates `PollImmediate()`, and golangci-lint
complains about the usage of the deprecated function.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-06-06 12:21:43 +00:00
Niels de Vos
e6627198d4 e2e: pass context.TODO() to k8s.e2e functions
Many Kubernetes test framework functions now require a context to be
passed. Use `context.TODO()` for this, just like is done for some of the
functions already.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-06-06 12:21:43 +00:00
riya-singhal31
92d9785166 cleanup: ErrWaitTimeout is deprecated in k8s 1.27
replaced ErrWaitTimeout with Interrupted

Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-06-06 12:21:43 +00:00
Niels de Vos
c968f6407d build: address dupword warnings
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-06-05 04:49:46 +00:00
Niels de Vos
4a6c27274f build: address ginkgolinter warnings
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-06-05 04:49:46 +00:00
Niels de Vos
9201da0502 build: address gofmt warnings
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-06-05 04:49:46 +00:00
Niels de Vos
a6c14c051f build: address golint warnings
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-06-05 04:49:46 +00:00
Niels de Vos
81218a69f9 build: address nolintlint errors from new golangci-lint
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-06-05 04:49:46 +00:00
Niels de Vos
8265abc2c9 nfs: add support for secTypes parameter in StorageClass
CephNFS can enable different security flavours for exported volumes.
This can be configured in the optional `secTypes` parameter in the
StorageClass.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
2023-05-04 12:21:46 +00:00
riya-singhal31
f12cd9c986 ci: fix codespell failure
Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-04-20 15:24:35 +00:00
riya-singhal31
6f54b88b26 e2e: remove extra check for snapshot count
snapshot count validation has already done after the deletion
of snapshot

Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-04-13 14:26:06 +00:00
Niels de Vos
9c0fa09f19 e2e: add test for mkfsOptions in RBD StorageClass
Create a 1G volume, with ext4 and only 1024 inodes. Use `df` to check if
the number of inodes is correct.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-03-08 16:26:39 +00:00
Niels de Vos
b7e1b90bb8 e2e: replace CephFS in messages for RBD tests
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-03-08 16:26:39 +00:00
riya-singhal31
b28b5e6c84 cephfs: use shallow volumes for the ROX accessMode
this commit makes shallow volume as default feature for ROX volumes.

Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-02-21 20:09:13 +00:00
riya-singhal31
60c98837ca e2e: fix typo
Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-02-15 08:13:41 +00:00
Madhu Rajanna
9c8de9471e rebase: update kubernetes to 1.26.1
update kubernetes and its dependencies
to v1.26.1

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-02-03 08:55:43 +00:00
Marcel Lauhoff
446c8c9264 e2e: Deploy vault as part of the Ceph FS upgrade suite
Deploy vault, analogue to the RBD upgrade suite to have the
ceph-csi-encryption-kms-config map ready when dependent
deployments/daemonsets are created.

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-11-23 12:21:02 +00:00
Marcel Lauhoff
e5ebd23709 e2e: add cephfs fscrypt snapshot volume test
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-11-23 12:21:02 +00:00
Marcel Lauhoff
a53a64129d e2e: add PVC-PVC clone Ceph FS fscrypt tests
Note: Feature fixed https://tracker.ceph.com/issues/57641

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-11-23 12:21:02 +00:00
Marcel Lauhoff
8d38107fd6 e2e: add basic PVC Ceph FS fscrypt tests
Test storage class, pvc and app bind of an fscrypt encrypted Ceph FS
with secrets metadata, vault, vault tokens and vault tenant KMS.

Tests are based on the RBD block/file encryption tests.

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-11-23 12:21:02 +00:00
Marcel Lauhoff
638f77a95c e2e: Deploy vault as part of the Ceph FS suite
Always deploy Vault as part of the the Ceph FS test suite.

Required by:
 - fscrypt tests using any vault KMS type.
 - Configuration in deploy/cephfs/*.yaml via the
   ceph-csi-encryption-kms-config config map created during deployVault()

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-11-23 12:21:02 +00:00
Marcel Lauhoff
42744213f6 e2e: Add test-cephfs-fscrypt flag
Add flag to default disable Ceph FS fscrypt tests, as they require a
custom minikube ISO

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-11-23 12:21:02 +00:00
Marcel Lauhoff
2ade867211 e2e: Add Ceph FS fscrypt validation helper
Add e2e helper to verify encrypted Ceph FS. Verify file's
ceph.fscrypt.auth attribute and KMS password creation / removal.

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-11-23 12:21:02 +00:00
Madhu Rajanna
28f51aaaf7 e2e: add snapshot count validation
Add snapshot count validation for cephfs
and nfs to avoid resource leak.

fixes: #3224

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-11-21 12:16:10 +00:00
Madhu Rajanna
c5a6d11a8f e2e: correct int format
use %d when formatting the int
value.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-11-21 12:16:10 +00:00
riya-singhal31
539686329f ci: fix mdl related failures
This commit address the issue-
https://github.com/ceph/ceph-csi/issues/3448.

Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2022-11-17 08:25:10 +00:00
Madhu Rajanna
d12400aa9c rbd: unset metadata if setmetadata is false
We need to unset the metadata on the clone
and restore PVC if the parent PVC was created
when setmetadata was set to true and it was
set to false when restore and clone pvc was
created.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-11-14 14:41:36 +00:00
Humble Chirammal
628263e9b1 e2e: use CurrentSpecReport for failed spec run
CurrentGinkgoTestDescription() has been deprecated in favor of
CurrentSpecReport and this commit address the same.

Ref#https://github.com/onsi/ginkgo/blob/master/deprecated_dsl.go#L53

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-11-10 09:30:38 +00:00
Madhu Rajanna
0530134c9a e2e: add e2e test for rbd reattach metadata
Added E2E test case to verify metadata after
PV is attached to a new PVC in different namespace.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-10-28 15:50:01 +00:00
Madhu Rajanna
09df2c6091 e2e: fix panic when checking error
fix panic during error handling

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-10-26 14:32:51 +00:00
Madhu Rajanna
607c654263 e2e: set privileged as pod security enforcement level
setting privileged as pod security enforcement level
to run test on kubernetes 1.25

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-10-26 14:32:51 +00:00
Marcel Lauhoff
69b8feec12 e2e: Feature flag RBD fscrypt tests (default disabled)
Add test-rbd-fscrypt feature flag to e2e suite. Default disabled as
the current CI system's kernel doesn't have the required features
enabled.

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-10-17 17:33:52 +00:00
Marcel Lauhoff
c73cb1980b e2e: Use utilEncryptionType instead of string in rbd suite
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-10-17 17:33:52 +00:00
Marcel Lauhoff
eae5b80298 e2e: Apply formatting to rbd suite and helper
Apply formatting for previous changes separately to make the commit
diffs easier to read.

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-10-17 17:33:52 +00:00
Marcel Lauhoff
9ad4bb1de5 e2e: Add encrypted PVC with default settings test
Add test that enables encryption with default type. Check that we set
up block encryption.

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-10-17 17:33:52 +00:00
Marcel Lauhoff
f5ba45b78f e2e: Run encryption related tests on file and block type
Replace `By` with `ByFileAndBlockEncryption` in all encryption related
tests to parameterize them to file and block encryption.

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-10-17 17:33:52 +00:00
Marcel Lauhoff
7db0c3bfbf e2e: Add PVC validator to ByFileAndBlockEncryption
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-10-17 17:33:52 +00:00
Marcel Lauhoff
0f626b705a e2e: Add helper to run encryption tests on block and file
Add a `By` wrapper to parameterize encryption related test functions
and run them on both block and file encryption

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-10-17 17:33:52 +00:00
Marcel Lauhoff
cec88a7bff e2e: Add fscrypt on rbd helper
Add validation functions for fscrypt on RBD volumes

Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
2022-10-17 17:33:52 +00:00
Niels de Vos
386d3ddd6e e2e: disable rbd-nbd tests by default
Because the rbd-nbd tests fail with minikube and the Podman driver,
disable the tests for the time being.

Updates: #3431
Signed-off-by: Niels de Vos <ndevos@redhat.com>
2022-10-13 10:45:35 +00:00
Niels de Vos
8eaf1d790d e2e: log failures while deleting PVC and PV
There are occasions where deleting a PVC (or PV) never succeeds. The
reported status of the deleted object is sometimes empty, which suggests
that the PVC or PV was, in fact, deleted.

To diagnose the incorrect error checking, include the errors for
retrying in the logs.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
2022-10-13 10:45:35 +00:00
Niels de Vos
8f915576c4 e2e: wait for deployment before scale down/up
The scale down/up functions fail often with "deployment not found"
errors. Possibly deploying with Podman is slower than deploying in a
minikube VM, and there is a delay for the deployment to become
available.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
2022-10-13 10:45:35 +00:00