Commit Graph

78 Commits

Author SHA1 Message Date
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
Patrick Ohly
d4729008ef e2e: simplify test cleanup
ginkgo.DeferCleanup has multiple advantages:
- The cleanup operation can get registered if and only if needed.
- No need to return a cleanup function that the caller must invoke.
- Automatically determines whether a context is needed, which will
  simplify the introduction of context parameters.
- Ginkgo's timeline shows when it executes the cleanup operation.
2022-12-13 08:09:01 +01:00
Jan Safranek
3fdd4ca7a4 Fix subpath disruptive tests
Add volumePath parameter to all disruptive checks, so subpath tests can use
"/test-volume" and disruptive tests can use "/mnt/volume1" for their
respective Pods.
2022-11-11 14:03:33 +01:00
Jan Safranek
802979c295 Add SELinux disruptive test 2022-11-08 12:42:20 +01: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
Jordan Liggitt
410ac59c0d Remove PodSecurityPolicy admission plugin 2022-05-04 16:00:56 -04:00
Masaki Kimura
382f37142c storage e2e: auto detect sector size 2021-05-11 22:32:05 +00:00
Jiawei Wang
988563f8f5 Extract testsuite api to a separate package
Extract TestSuite, TestDriver, TestPattern, TestConfig
and VolumeResource, SnapshotVolumeResource from testsuite
package and put them into a new package called api.

The ultimate goal here is to make the testsuites as clean
as possible. And only testsuites in the package.
2020-12-10 11:12:51 -08:00
Fabio Bertinatto
ee082985c2 e2e: promote use of functions that support custom timeouts in storage tests.
WaitForPodSuccessInNamespace[Slow] are replaced by WaitForPodSuccessInNamespaceTimeout(),
so that custom timeouts are used instead of the hardcoded ones.
2020-12-02 16:14:13 -03:00
Fabio Bertinatto
c82626f96f e2e: use custom timeouts in all storage E2E tests 2020-12-02 15:57:58 -03:00
Christian Huffman
4d2d063635 Included e2e test for CSIDriver FSGroupPolicy 2020-11-12 16:30:38 -05:00
Jing Xu
56373aa10d Update storage test suits for Windows
Update storage test suits to enable some tests on Windows

Change-Id: I1f596bb9f7a0f41ae398aec43406ee5c753cdce3
2020-11-11 15:22:47 -08:00
Saikat Roychowdhury
a07096952b FsgroupChange policy test suite 2020-11-10 08:36:07 +00:00
Kubernetes Prow Robot
d39562fd93
Merge pull request #95863 from RaunakShah/snap_e2e
Volume snapshot e2e test to validate PVC finalizer
2020-11-05 10:53:06 -08:00
shahra
e95af138b5 Volume snapshot e2e test to validate
VolumeSnapshotContent and PVC finalizer
2020-11-04 14:08:24 -08:00
Jan Safranek
96e3bc1bfa Log PodExec stdout + stderr
e2e tests should log stdout / stderr of failed commands executed via
PodExec. "command terminated with exit code 1" is not really useful.
2020-10-26 13:22:18 +01:00
Niels de Vos
f2bf2ab76e e2e/storage: disable caching when writing/reading to block PVCs
By passing "oflag=nocache" and "iflag=direct", caching should be
disabled while writing/reading with "dd" to a block device. The
TestConcurrentAccessToSingleVolume() test is known to fail with certain
storage backends (like Ceph RBD) when caching is enabled.

The default BusyBox image used for testing does not support the required
options for "dd". So instead of running with BusyBox, run the test with
a Debian image.
2020-09-25 14:38:32 +02:00
Andi Li
7918f69055 Remove custom hash function, generate a random UUID for snapshot and snapcontent name instead 2020-08-28 12:36:15 -04:00
Andi Li
a4498846b1 Quick commit 2020-08-28 12:36:15 -04:00
Andi Li
ed85129831 Minor cleanup in snapshot test suite. 2020-08-28 12:29:07 -04:00
Jiawei Wang
d030c64743 [e2e]Bind csi driver namespace to test namespace to avoid namespace collision 2020-08-12 10:20:30 -07:00
Grant Griffiths
e1f0e4cd9f Add retain policy test and refactor snapshottable tests
Signed-off-by: Grant Griffiths <grant@portworx.com>
2020-06-17 19:53:53 -07:00
Hemant Kumar
da941d8d3e Create mock CSI driver resources in different namespace 2020-05-13 11:16:00 -04:00
tanjunchen
d18e6569e0 use e2epod.WaitForPodNotFoundInNamespace directly 2020-03-21 15:11:40 +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
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
Kubernetes Prow Robot
14ed35712c
Merge pull request #87168 from misterikkit/timout-err
storage e2e: Add context to timeout errors
2020-01-15 01:22:32 -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
Jing Xu
51d5303662 Fix err variable shadowing issue in storage/utils
Issue: https://github.com/kubernetes/kubernetes/issues/86884
This PR fixes the issue that err variable gets shadowed. Because of
this, it might get nil pointer error.

Change-Id: Ib7da918418a7c8148a6ca598db12b3744eb3b7c8
2020-01-06 12:15:29 -08:00
danielqsj
fc738cbb1d unify alias of api errors under test 2019-12-26 16:40:45 +08:00
Kubernetes Prow Robot
4ca93592d2
Merge pull request #86147 from tanjunchen/use-framework-Equal-20191211
test/e2e/storage : use framework.Equal() replace gomega.Expect(...).To(gomega.BeTrue(),...)
2019-12-11 11:32:24 -08:00
tanjunchen
f8e0c6bb41 test/e2e/storage : use framework.Equal() replace gomega.Expect(...).To(gomega.BeTrue(),...) 2019-12-11 16:25:26 +08:00
SataQiu
e70120f083 fix staticcheck failures of e2e/storage/utils e2e/storage/vsphere 2019-12-11 10:33:21 +08:00
tanjunchen
9eda99793d use ExpectEqual of framework in test/e2e/storage 2019-12-03 17:41:49 +08:00
Olev Kartau
373909946e utils.go: Changed bashExec to shExec, bash not guaranteed. 2019-11-12 14:42:24 +02:00
Olev Kartau
2fac3f2c20 test/e2e: Reduce need to use local kubectl
Use POST method instead of running local kubectl.
Use ExecCommandInContainerWithFullOutput() instead of RunKubectl().
PodExec() takes additional framework arg, passed down in call chain.
VerifyExecInPodFail uses different error code cast as original
one causes test code Panic if used with new call method.
2019-11-12 14:42:24 +02:00
Kenichi Omichi
94211f1839 Move functions from e2e framework util.go
The following functions are called at some specific places only,
so this moves these functions to the places and makes them local.

- WaitForPersistentVolumeClaimDeleted: Moved to e2e storage
- PrintSummaries: Moved to e2e framework.go
- GetHostExternalAddress: Moved to e2e node
- WaitForMasters: Moved to e2e cloud gcp
- WaitForApiserverUp: Moved to e2e network
- WaitForKubeletUp: Moved to e2e storage vsphere
2019-11-08 19:25:16 +00:00
Yecheng Fu
8def74f394 use HostExec and sets.String 2019-10-28 10:35:06 +08:00
Yecheng Fu
25c5ad52fd simplify global mount points check 2019-10-28 10:35:06 +08:00
Yecheng Fu
b536395c07 Add e2e test to check for filesystem volume device mount cleanup 2019-10-28 10:35:02 +08:00
Jan Safranek
612fb1793e Test global block directory in reconstruction tests 2019-10-04 14:03:40 +02:00
Kubernetes Prow Robot
ec05944b13
Merge pull request #83108 from jsafrane/hostexec-volumemode
Use pod + nsenter instead of SSH in block volume tests
2019-10-04 02:46:29 -07:00
John Schnake
2dab911ac2 Use imageutils instead of hardcoded image paths
A number of tests were using hardcoded image paths instead of
going through the imageutils package. The reason for centralizing
the logic there is to keep an eye on what images we use and where
they come from.
2019-09-27 15:01:08 -05:00
Jan Safranek
c1c0ba1c76 Use pod + nsenter instead of SSH in block volume tests
listPodVolumePluginDirectory was moved to break import cycle.
2019-09-25 13:34:27 +02: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
5c68a231ab
Merge pull request #81620 from wongma7/nfs-alpha
Bump nfs-provisioner to include GetReference fix
2019-08-20 10:47:15 -07:00
Matthew Wong
9da84cfbdf Bump nfs-provisioner to include GetReference fix 2019-08-16 16:54:08 -07:00
Jan Safranek
2c79ffe274 Add test for unused volumes 2019-08-15 10:48:41 +02:00