Commit Graph

67 Commits

Author SHA1 Message Date
Patrick Ohly
136f89dfc5 e2e: use error wrapping with %w
The recently introduced failure handling in ExpectNoError depends on error
wrapping: if an error prefix gets added with `fmt.Errorf("foo: %v", err)`, then
ExpectNoError cannot detect that the root cause is an assertion failure and
then will add another useless "unexpected error" prefix and will not dump the
additional failure information (currently the backtrace inside the E2E
framework).

Instead of manually deciding on a case-by-case basis where %w is needed, all
error wrapping was updated automatically with

    sed -i "s/fmt.Errorf\(.*\): '*\(%s\|%v\)'*\",\(.* err)\)/fmt.Errorf\1: %w\",\3/" $(git grep -l 'fmt.Errorf' test/e2e*)

This may be unnecessary in some cases, but it's not wrong.
2023-02-06 15:39:13 +01:00
Antonio Ojea
7f5ae1c0c1
Revert "e2e: wait for pods with gomega" 2023-02-06 12:08:22 +01:00
Patrick Ohly
222f655062 e2e: use error wrapping with %w
The recently introduced failure handling in ExpectNoError depends on error
wrapping: if an error prefix gets added with `fmt.Errorf("foo: %v", err)`, then
ExpectNoError cannot detect that the root cause is an assertion failure and
then will add another useless "unexpected error" prefix and will not dump the
additional failure information (currently the backtrace inside the E2E
framework).

Instead of manually deciding on a case-by-case basis where %w is needed, all
error wrapping was updated automatically with

    sed -i "s/fmt.Errorf\(.*\): '*\(%s\|%v\)'*\",\(.* err)\)/fmt.Errorf\1: %w\",\3/" $(git grep -l 'fmt.Errorf' test/e2e*)

This may be unnecessary in some cases, but it's not wrong.
2023-01-31 13:01:39 +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
Claudiu Belu
35e23afa50 tests: Prepull images commonly used test images
Some tests have a short timeout for starting the pods (1 minute), but if
those tests happen to be the first ones to run, and the images have to be
pulled, then the test could timeout, especially with larger images. This
commit will allow us to prepull commonly used E2E test images, so this issue
can be avoided.
2021-11-05 14:22:50 -07:00
wojtekt
3b438eb4e5 Cleanup test/e2e/common directory - part2 2021-03-03 10:27:35 +01:00
wojtekt
7b2458ac01 Cleanup tests/e2e/common directory - part 1 2021-02-24 20:44:14 +01:00
Tim Hockin
3bd337baf4 Make tests deal with old and new topology labels 2020-11-12 11:22:47 -08:00
Tim Hockin
819ff9b087
Use topology labels instead of old beta names (#96033)
* Rename const for topology.../zone

* Rename const for topology.../region

* Rename const for failure-domain.../zone

* Rename const for failure-domain.../region

* Restore old names for compat
2020-11-05 20:26:50 -08:00
Claudiu Belu
c99b18580d tests: Refactor agnhost image pod usage - common (part 1)
A previous commit added  a few agnhost related functions that creates agnhost
pods / containers for general purposes.

Refactors tests to use those functions.
2020-09-26 05:29:33 -07:00
alejandrox1
4338053d8f Renamed image "white lists" to pre-pull image lists in test
Signed-off-by: alejandrox1 <alarcj137@gmail.com>
2020-07-01 13:48:47 -04:00
RobertKielty
5c27c7e304 renames CommmonImageWhiteList to PrePulledImages in e2e/common/util
Part of work to remove racist language, this name change also improves on the
  semantics of this variable name as it was not actually a list of permissible
  images but rather a list of images that are required for e2e_node tests that
  are to be pre-pulled so that they are available prior to running e2e tests.

  Worth noting that this list of images is "union merged" with another list when
  setting up e2e_node tests and as such there is the possibilty for overlap.

 # Please enter the commit message for your changes. Lines starting
2020-06-21 18:46:06 +01:00
Kubernetes Prow Robot
fc9d174102
Merge pull request #88248 from claudiubelu/tests/reduce-to-agnhost-mounttest
tests: Replaces mounttest images used with agnhost (part 4)
2020-04-22 04:53:52 -07:00
Kenichi Omichi
5f81f5b96c Move GetFileModeRegex to e2e/common
because the function is used at e2e/common tests only.
2020-03-23 23:23:54 +00:00
Claudiu Belu
1b71b2a9a2 tests: Replaces mounttest images used with agnhost (part 4)
Quite a few images are only used a few times in a few tests. Thus,
the images are being centralized into the agnhost image, reducing
the number of images that have to be pulled and used.

This PR replaces the usage of the following images with agnhost:

- mounttest
- mounttest-user

Additionally, removes the usage of the mounttest-user image and removes
it from kubernetes/test/images. RunAsUser is set instead of having that image.
2020-02-29 15:05:57 -08:00
Claudiu Belu
f7942290af tests: Replaces images used with agnhost (part 4)
Quite a few images are only used a few times in a few tests. Thus,
the images are being centralized into the agnhost image, reducing
the number of images that have to be pulled and used.

This PR replaces the usage of the following images with agnhost:

- resource-consumer-controller
- test-webserver
2020-02-18 16:29:49 -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
tanjunchen
1db3f45dc5 test/e2e/framework/rc/:refactor function ByNameContainer 2020-01-16 13:49:02 +08:00
SataQiu
50bc528a7e e2e: move LogFailedContainers out of e2e test framework util.go 2019-11-15 10:21:26 +08:00
Kubernetes Prow Robot
0386d769cc
Merge pull request #83058 from bclau/tests/windows-tests-support
tests: Fixes tests for Windows (containerd, RunAsUserName)
2019-11-14 16:37:13 -08:00
Claudiu Belu
e8d062bd4a tests: Replaces guestbook with agnhost equivalent
The redis version has been bumped to version 5.0.5, but the maximum version supported on
Windows is 3.2. This can lead to failing tests, the output and behaviour can be different
(see #80516). In order to prevent such failures, the amount of times the Redis image is
used can be reduced.

This commit uses the previously added agnhost guestbook subcommand as a replacement for the
Guestbook application created by the test "should create and stop a working application".

Adds AgnhostPrivate to test/utils/image/manifest. Some tests are trying to pull
the agnhost image from the private registry, meaning that we would need to
always build and push the agnhost image to both e2e and private registry
whenever we bump its version. Decoupling them would mean that we only need
to push the image to the e2e registry.
2019-11-12 07:23:04 -08:00
Claudiu Belu
f0e6d8ed09 tests: Fixes tests for Windows (containerd, RunAsUserName)
Since we've added support for RunAsUserName, we can now run some new
tests. However, the [LinuxOnly] tag will have to remain until the
WindowsRunAsUserName feature becomes enabled by default.

Additionally, Containerd supports file mounting on Windows, and some
tests will be able to pass on Windows with Containerd instead of Docker.
2019-11-06 19:14:21 -08:00
SataQiu
24f374a395 move test specific functions from rc_util.go 2019-10-29 13:04:59 +08:00
Kubernetes Prow Robot
b5c74a3f26
Merge pull request #82817 from zouyee/scpq
fix Security Context should run with an image specified user ID
2019-10-18 12:37:22 -07:00
YuikoTakada
9ed2f632cc use log functions of core framework 2019-09-26 02:45:07 +00:00
zouyee
51653480c9 fix Security Context should run with an image specified user ID
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2019-09-24 20:26:34 +08:00
Kubernetes Prow Robot
cce048123d
Merge pull request #80610 from aojea/ipv6kubectl
Add ipv6 support to the e2e kubectl tests
2019-08-05 13:36:02 -07:00
Jeffrey Sica
ea2f6c80d7 support args for newrc funcs 2019-07-28 11:45:43 -04:00
Antonio Ojea
8988965df1
Add ipv6 support to the e2e kubectl tests 2019-07-26 00:40:46 +02:00
Antonio Ojea
33e1b1d8a5
Use docker official redis images 2019-07-13 17:01:25 +02:00
Claudiu Belu
c752ea8134 tests: Replaces images used with agnhost (part 3)
Quite a few images are only used a few times in a few tests. Thus,
the images are being centralized into the agnhost image, reducing
the number of images that have to be pulled and used.

This PR replaces the usage of the following images with agnhost:

- audit-proxy
- crd-conversion-webhook
- entrypoint-tester
- inclusterclient
- iperf
- porter
- serve-hostname
2019-06-26 13:33:55 -07:00
Kubernetes Prow Robot
dc8b928136
Merge pull request #79162 from SataQiu/fix-test-20190619
Refactor: replace framework.Failf with e2elog.Failf
2019-06-21 12:17:04 -07:00
Kubernetes Prow Robot
c898ab2043
Merge pull request #78378 from k-toyoda-pi/golint_test_e2e_common_s-v
Fix golint failure in e2e/common/util.go
2019-06-20 12:58:35 -07:00
SataQiu
332be4b1e3 refactor: replace framework.Failf with e2elog.Failf 2019-06-19 17:52:35 +08:00
Claudiu Belu
9e81f3b50b tests: Replaces images used with agnhost (part 2)
Quite a few images are only used a few times in a few tests. Thus,
the images are being centralized into the agnhost image, reducing
the number of images that have to be pulled and used.

This PR replaces the usage of the following images with agnhost:

- net
- netexec
- nettest
- webhook
2019-06-17 06:04:18 -07:00
toyoda
c4a96d3215 fix golint failure in e2e/common/util.go 2019-06-17 10:10:36 +09:00
Kubernetes Prow Robot
c5087f25c0
Merge pull request #78916 from mkimuram/rem-dot-import
Remove . import from e2e test
2019-06-15 16:34:08 -07:00
Masaki Kimura
701395c392 Remove dot import from e2e test and replace with framework.ExpectNoError 2019-06-14 20:46:11 +00:00
Claudiu Belu
bd8cb8fae0 tests: Replaces images used with agnhost (part 1)
Quite a few images are only used a few times in a few tests. Thus,
the images are being centralized into the agnhost image, reducing
the number of images that have to be pulled and used.

This PR replaces the usage of the following images with agnhost:

- fakegitserver
- hostexec
- liveness
- logs-generator
- no-snat-test
- no-snat-test-proxy
- port-forward-tester
2019-06-13 15:05:50 -07:00
Jiaying Zhang
8175579a0c add recreate node e2e test
Move recreate_node test to gce provider tests.
2019-04-12 16:00:19 -07:00
Patrick Barker
45d715cdc6 adds dynamic audit e2e test 2019-03-05 14:38:58 -07:00
Davanum Srinivas
b975573385
move pkg/kubelet/apis/well_known_labels.go to staging/src/k8s.io/api/core/v1/
Co-Authored-By: Weibin Lin <linweibin1@huawei.com>

Change-Id: I163b2f2833e6b8767f72e2c815dcacd0f4e504ea
2019-02-05 13:39:07 -05:00
Claudiu Belu
fd4f55375b tests: Removed hardcoded images from yaml files
Some tests use .yaml files to deploy pods, which have hardcoded
images. Those images cannot be used for Windows containers.

The image names can be injected by the tests themselves, based on
the configured registries.
2019-01-15 20:22:19 -08:00
thdrnsdk
2cd42c3600 delete the busyboxImage and mountTest var and change use imageutils 2018-08-14 22:37:40 +09:00
Davanum Srinivas
6cd8bd62fe
e2e test harness - use busybox from dockerhub
Use the same pattern everywhere in the e2e test
harness, use busybox (from dockerhub) instead
of using the one from k8s.gcr.io registry.

Change-Id: I57c3b867408c1f9478a8909c26744ea0368ff003
2018-08-07 11:22:16 -04:00
Manjunath A Kumatagi
1f7f33aaa4 Update the nginx image from hub.docker.com 2018-08-04 05:19:53 +05:30
Davanum Srinivas
0965db0ccf
Remove unused images
Change-Id: I6be2d14df736f5ae592d7e95713445b3d1c67a16
2018-07-30 18:40:17 -04:00
wojtekt
0a5dcb63af Fix restart nodes tests for Regional Clusters 2018-04-09 12:28:00 +02:00
Filipe Brandenburger
46a83c2883 Use ipc-utils container in HostIPC tests.
This ensures the `ipcs` command from util-linux will be used, which
succeeds when Docker is running with SELinux enabled (while the one from
busybox fails.)

Tested: On a host with Docker running with SELinux enabled:

  $ make test-e2e-node REMOTE=true FOCUS="host IPC"

  • [SLOW TEST:17.272 seconds] (passed)
  [k8s.io] Security Context
    when creating a pod in the host IPC namespace
      should show the shared memory ID in the host IPC containers

  • [SLOW TEST:20.419 seconds] (passed)
  [k8s.io] Security Context
    when creating a pod in the host IPC namespace
      should not show the shared memory ID in the non-hostIPC containers

  Ran 2 of 257 Specs in 43.934 seconds
  SUCCESS! -- 2 Passed | 0 Failed | 0 Pending | 255 Skipped
2018-01-25 11:09:16 -08:00