Commit Graph

31 Commits

Author SHA1 Message Date
Jan Safranek
ba099644b2 Remove global framework variable
`f framework.Framework` does not need to be global, it's used only on a few
places.

This fixes vSphereDriver.PrepareTest() in in_tree.go that schedules
ginkgo.DeferCleanup() that uses the global `f` variable, but its value is not
valid at the time of ginkgo cleanup.
2023-02-20 11:00:12 +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
Patrick Ohly
df5d84ae81 e2e: accept context from Ginkgo
Every ginkgo callback should return immediately when a timeout occurs or the
test run manually gets aborted with CTRL-C. To do that, they must take a ctx
parameter and pass it through to all code which might block.

This is a first automated step towards that: the additional parameter got added
with

    sed -i 's/\(framework.ConformanceIt\|ginkgo.It\)\(.*\)func() {$/\1\2func(ctx context.Context) {/' \
        $(git grep -l -e framework.ConformanceIt -e ginkgo.It )
    $GOPATH/bin/goimports -w $(git status | grep modified: | sed -e 's/.* //')

log_test.go was left unchanged.
2022-12-10 19:50:18 +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
Patrick Ohly
fc092eb145 e2e: remove cleanup actions
The framework.AddCleanupAction API was a workaround for Ginkgo v1 not invoking
AfterEach callbacks after a test failure. Ginkgo v2 not only fixed that, but
also added a DeferCleanup API which can be used to run some code if (and only
if!) the corresponding setup code ran. In several cases that makes the test
cleanup simpler.
2022-09-09 13:51:07 +02:00
Joe Betz
7be77f9ecc changes code to improve output for files under test/e2e/storage 2022-09-02 17:43:41 +05:30
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
Sergiusz Urbaniak
1495c9f2cd
test/e2e/*: default existing tests to privileged pod security policy
This is to ensure that all existing tests don't break when defaulting
the pod security policy to restricted in the e2e test framework.
2022-04-05 08:41:12 +02:00
David Eads
c8f87a6a24 retry PV create in e2e-test on API quota failure 2021-10-26 09:47:16 -04:00
Fabio Bertinatto
c82626f96f e2e: use custom timeouts in all storage E2E tests 2020-12-02 15:57:58 -03:00
Chethan Venkatesh
3e19a33cea Fix typo in vsphere e2e tests 2020-07-06 11:39:26 -07:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Jonathan Basseri
09121d9686 Add missing tag to vSphere storage E2E tests
This adds the [Feature:vsphere] tag to those vSphere tests which were
missing it. This makes it easier to specifically target the vSphere
storage E2E test suite.
2020-02-10 14:48:55 -08:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
yuxiaobo
73fb0ab5ec test/e2e/storage:Use e2eskipper package
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2020-01-13 14:04:10 +08:00
tanjunchen
9eda99793d use ExpectEqual of framework in test/e2e/storage 2019-12-03 17:41:49 +08:00
Dan Winship
6a040438ea Update test/e2e/storage for new GetReadySchedulableNodes stuff 2019-10-09 08:12:56 -04: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
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
John Schnake
37212fa934 Ensure tests which rely on SSH behavior are skipped if unavailable
A number of tests rely on SSH behavior but are not marked with
SkipUnlessSSHKeysPresent(). This means that the tests will run and
hang. This can be confusing for users because they may not know why
the tests failed. Instead, we should be reporting on the known issue
and skipping the test (hence why the helper Skip... function exists).
2019-08-07 10:24:39 -05:00
danielqsj
8a6fede9e6 remove dot imports in e2e/storage/vsphere 2019-05-10 13:56:16 +08:00
John Schnake
a6f5ebf831 Move storage tests to use the framework/log package
This is part of the transition to using framework/log instead
of the Logf inside the framework package. This will help with
import size/cycles when importing the framework or subpackages.
2019-05-04 12:50:38 -05:00
Masaki Kimura
b474b28f7b Use framework.ExpectNoError() for rest of under test/e2e/storage 2019-04-04 18:51:51 +00:00
Anusha Ragunathan
b13d35caf7 Fix Panic in PersistentVolumes:vsphere
Bootstrap initializes the necessary vSphere objects before the tests are
run. A call to Bootstrap was missing in persistent_volumes-vsphere.go's
BeforeEach. This results in Panic while running e2e tests for 'vsphere'
provider with a stack trace like this:

  	/usr/local/go/src/runtime/panic.go:502 +0x229
  github.com/docker/kube-e2e-image/vendor/k8s.io/kubernetes/test/e2e/storage/vsphere.glob..func1.1()
  	/go/src/github.com/docker/kube-e2e-image/vendor/k8s.io/kubernetes/test/e2e/storage/vsphere/persistent_volumes-vsphere.go:77
+0xa21
  github.com/docker/kube-e2e-image/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc4217c9b60,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
  	/go/src/github.com/docker/kube-e2e-image/e2e_test.go:88 +0x2c8
  testing.tRunner(0xc4206e01e0, 0x4212900)
  	/usr/local/go/src/testing/testing.go:777 +0xd0
  created by testing.(*T).Run
  	/usr/local/go/src/testing/testing.go:824 +0x2e0

This change fixes the Panic by calling Bootstrap.

Testing:
After this change, tests with FOCUS set to "PersistentVolumes:vsphere"
 dont Panic. They pass as expected.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2018-09-21 13:46:58 -07:00
Kubernetes Submit Queue
26135c5f4b
Merge pull request #62303 from msau42/fix-subpath-reconstruct-test
Automatic merge from submit-queue (batch tested with PRs 62650, 62303, 62545, 62375). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Refactor subpath reconstruction tests to use util test

**What this PR does / why we need it**:
Use common util method for reconstruction tests so that test updates will be reflected in all e2es.  Also increase termination grace period to allow more time for volume manager to cleanup before the tests check for leftover mounts

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #62293

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-16 13:56:07 -07:00
Michelle Au
7aca917ea4 Refactor subpath reconstruction tests to use util test 2018-04-11 14:20:29 -07:00
xiangpengzhao
1f80008f41 Remove the use of storage class beta annotations in e2e tests. 2018-04-10 15:29:08 +08:00
Hemant Kumar
b85c4fc57a Refactor disruptive tests to use more volume types 2018-03-16 11:49:22 -04:00
Divyen Patel
c0490fa623 removing production code usage from e2e tests code 2018-02-13 10:41:16 -08:00
Rohit Jog
015e20cb15 e2e test layout changes for vsphere (#398) 2017-12-18 10:19:18 -08:00