Commit graph

192 commits

Author SHA1 Message Date
Patrick Ohly
fcc5d50fde E2E node: consider ARTIFACTS env variable for results dir
`make test-e2e-node` sets the -results-dir based on the ARTIFACTS Prow job env
variable. When e2e_node.test gets invoked directly, it should do the same,
otherwise JUnit and log files are not captured for the job.
2026-06-21 11:57:09 +02:00
Patrick Ohly
de2d13b27e e2e_node: support pre-built binaries
This is not usable through "make test-e2e-node", which (while feasible) would
be a bit pointless because the Kubernetes source could would still be needed
for the make rules.

Instead, "kubetest2 noop -test=node" gets extended to invoke `e2e_node.test
remote` with flags that tell e2e_node.test where to find the binaries and
flags that were provided by the caller of kubetest2.
2026-06-03 10:32:48 +02:00
Patrick Ohly
2d574790a6 e2e_node: fix log output
fmt.Printf lacked the trailing newline and is inconsistent with other output,
which uses klog.
2026-06-03 08:34:56 +02:00
Patrick Ohly
6ba4d21765 e2e_node: multiplex different commands in e2e_node.test
The additional commands (mounter, gcp-credentials-provider) are needed for E2E
node testing. This change makes e2e_node.test entirely self-contained.

Copying the commands' code into separate packages is temporary and only done to
avoid touching them while it is still unclear whether this approach will work
out.

Besides avoiding changes to the build rules, bundling the functionality also has a
slight size advantage: the size of e2e_node.test increases by 10KB, whereas
the other two separate commands would add 10MB.
2026-06-03 08:34:56 +02:00
Patrick Ohly
62cfe57459 e2e_node: avoid polluting e2e_node command line with helper packages
e2e_node.test depends on test/e2e_node/builder and test/e2e_node/remote because
test/e2e_node/services/ uses some small helper functions from those two
packages. But e2e_node.test itself never builds any Go binaries, nor does it
run remote testing - that functionality is provided by the separate
test/e2e_node/runner commands.

Therefore these two packages should not put their command line flags into
flag.CommandLine because then they show up in the command line of e2e_node test
unnecessarily.

This change removes the following flags from the e2e_node.test command line:

    diff -r before/e2e_node after/e2e_node
    7,8d6
    <       --build-only                                                 If true, build e2e_node_test.tar.gz and exit.
    <       --cleanup                                                    If true remove files from remote hosts and delete temporary instances (default true)
    20d17
    <       --delete-instances                                           If true, delete any instances created (default true)
    42d38
    <       --ginkgo-flags string                                        Passed to ginkgo to specify additional flags such as --skip=.
    95d90
    <       --gubernator                                                 If true, output Gubernator link to view logs
    97d91
    <       --hosts string                                               hosts to test
    99,100d92
    <       --image-config-dir string                                    (optional) path to image config files
    <       --image-config-file string                                   yaml file describing images to run
    103d94
    <       --images string                                              images to test
    105,106d95
    <       --instance-name-prefix string                                prefix for instance names
    <       --k8s-bin-dir string                                         Directory containing k8s kubelet binaries.
    120d108
    <       --mode string                                                Mode to operate in. One of gce|ssh. Defaults to gce (default "gce")
    133d120
    <       --results-dir string                                         Directory to scp test results to. (default "/tmp/")
    142,145d128
    <       --ssh-env string                                             Use predefined ssh options for environment.  Options: gce
    <       --ssh-key string                                             Path to ssh private key.
    <       --ssh-options string                                         Commandline options passed to ssh.
    <       --ssh-user string                                            Use predefined user for ssh.
    160,161d142
    <       --target-build-arch string                                   Target architecture for the test artifacts for dockerized build (default "linux/amd64")
    <       --test-timeout duration                                      How long (in golang duration format) to wait for ginkgo tests to complete. (default 45m0s)
    196d176
    <       --test_args string                                           Space-separated list of arguments to pass to Ginkgo test runner.
    198d177
    <       --use-dockerized-build                                       Use dockerized build for test artifacts
2026-05-20 12:00:01 +02:00
yashsingh74
afdb5e5d1f
Update CNI plugins to v1.9.1
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2026-04-01 14:06:34 +05:30
yashsingh74
1618bf1357
Update CNI plugins to v1.9.0
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2025-12-10 10:01:39 +05:30
Stanislav Láznička
805eb885e3
node e2e: add tests for Ensure Secret Image Pulls default policy
Signed-off-by: Stanislav Láznička <slznika@microsoft.com>

Co-authored-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-11-11 11:15:53 -05:00
Sascha Grunert
f0be916f7a
Update CNI plugins to v1.8.0
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-09-02 08:39:57 +02:00
Gavin Lam
908fb0266d
Fix gocritic issues
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2025-07-24 23:23:43 -04:00
Anish Ramasekar
4d2566eb5a
credentialprovider: wire in service account mode cache type
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-07-10 14:50:54 -05:00
Adrian Moisey
e5ffec242a
Bump CNI to 1.7.1 2025-05-04 20:27:09 +02:00
Anish Ramasekar
2090a01e0a
add e2e test with the gcp-credential-provider test plugin
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 20:36:36 -07:00
Ed Bartosh
65c792ca9b e2e_node: remote: fix getting pod logs 2025-02-27 09:04:43 +02:00
carlory
c48499d360 fix ci
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-02-17 11:49:24 +08:00
Patrick Ohly
46a17f60e4 E2E node: fix --timeout default
For unknown reasons, hack/make-rules/test-e2e-node.sh adds -timeout instead of
--timeout. Therefore the fallback code in test/e2e_node/remote/remote.go didn't
find it and added its own --timeout=60m after it. This effectively limits E2E
node test runs to 60 minutes, regardless of what is specified in the job:

    W0206 09:53:51.425532    7151 remote.go:158] ginkgo flags are missing explicit --timeout (ginkgo defaults to 60 minutes)
    I0206 09:53:51.425565    7151 remote.go:165] updated ginkgo flags: -timeout=24h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky && !Slow"  --no-color -v --timeout=60m
    ...
    I0206 09:53:57.767096    7151 ssh.go:146] Running the command ssh, with args: ... timeout -k 30s 3600.000000s ./ginkgo -timeout=24h --label-filter="Feature: containsAny DynamicResourceAllocation && Feature: isSubsetOf { Beta, DynamicResourceAllocation } && !Flaky && !Slow"  --no-color -v --timeout=60m ...

Note that the timeout for the test was 60m in this case (hence the "timeout -k
30s 3600.000000s") but it could also be something larger.
2025-02-06 11:45:12 +01:00
Sascha Grunert
da999fbc1b
Update CNI plugins to v1.6.2 and avoid using k8s-artifacts-cni bucket
Updating the CNI plugins to the latest release and switch over to use
GitHub releases instead of the `k8s-artifacts-cni` bucket.

Follow-up on https://github.com/kubernetes/kubernetes/pull/129095

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-01-23 10:50:58 +01:00
upodroid
dce863e5e6 fetch cni plugins from GitHub releases 2024-12-05 13:31:35 +03:00
Sascha Grunert
237c7e38bd
Update cni-plugins to v1.6.0
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-10-18 11:06:54 +02:00
Achraf BOUAOUDA
d900efafcc feat(test-e2e): support custom network and subnet on remote e2e mode 2024-09-24 00:25:41 +02:00
Sascha Grunert
931b9b3a70
Update cni-plugins to v1.5.1
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-08-28 12:58:36 +02:00
Davanum Srinivas
2db4c4aaab
Set ginkgo time if not specified explicitly
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-07-12 11:33:22 -04:00
bzsuni
61a35c2186 update cni from 1.4.1 to 1.5.0
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2024-05-25 10:33:52 +08:00
Kubernetes Prow Robot
6f995a4bbc
Merge pull request #124181 from testwill/close_tmpfile
fix: close tmp file
2024-04-18 03:24:08 -07:00
Kubernetes Prow Robot
7f67cb5960
Merge pull request #123969 from liangyuanpeng/cleanup_rand
cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator.
2024-04-18 02:10:26 -07:00
guoguangwu
ad7799d07d fix: close tmp file
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
2024-04-06 10:55:08 +08:00
Lan Liang
dc992adad3 cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator.
see https://tip.golang.org/doc/go1.20

Signed-off-by: Lan Liang <gcslyp@gmail.com>
2024-03-18 08:10:12 +00:00
Sascha Grunert
a35b75ee57
Update cni-plugins to v1.4.1
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-03-12 12:06:52 +01:00
Peter Hunt
646d464203 e2e_node: use kubelet_exec_t instead of bin_t for kubelet
as bin_t isn't powerful enough, and we run into a wack-a-mole situation making bin_t powerful
enough for the tests

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2024-03-05 13:39:52 -05:00
Davanum Srinivas
c61b2a3975
Check length of instance name before truncating
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-03-03 18:49:57 -05:00
Davanum Srinivas
968aefd1bf
Ensure GCP instance names are a max of 63 characters
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-03-03 13:19:12 -05:00
Kubernetes Prow Robot
57e9981dc2
Merge pull request #122865 from pohly/e2e-framework-logging
e2e framework: unify logging, support skipping helpers
2024-02-01 09:37:02 -08:00
Davanum Srinivas
717a0002b7
[gce_runner] use metadata file when values have special characters
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-01-30 15:55:51 -08:00
Davanum Srinivas
4716bf8bd4
Fix issues found by linter
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-01-28 06:05:04 -05:00
Davanum Srinivas
76ea142051
Use gcloud for gce_runner
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-01-27 22:23:37 -05:00
Patrick Ohly
dd0cee4895 e2e node runner: remove dependency on e2e/framework
A stand-alone binary shouldn't import the test/e2e/framework, which is targeted
towards usage in a Ginkgo test suite. This currently works, but will break once
test/e2e/framework becomes more opinionated about how to configure logging.

The simplest solution is to duplicate the one short function that the binary
was calling in the framework.
2024-01-20 18:23:31 +01:00
Kubernetes Prow Robot
7db7824d85
Merge pull request #122178 from saschagrunert/cni-plugins
Update cni-plugins to v1.4.0
2024-01-04 18:00:07 +01:00
Sascha Grunert
1ae5594fb2
Update cni-plugins to v1.4.0
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-12-13 09:33:31 +01:00
upodroid
e2227a24fb switch to e2 machine types 2023-10-31 21:46:14 +00:00
Sai Ramesh Vanka
8e52fc7266 Minor fix to copy the required kubelet, service logs after the execution of the node e2e tests
* It is observed in some of the periodic job results that the kubelet along with few other logs
are not getting copied to the artifacts directory once the node e2e tests are executed
* Following is the sample error log that is displayed once the tests are run
```
I1031 13:15:49.056897   40204 ssh.go:146] Running the command ssh, with args: [-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o CheckHostIP=no -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o LogLevel=ERROR -i /home/svanka/.ssh/google_compute_engine core@35.185.108.51 -- sudo ls core@35.185.108.51:/tmp/node-e2e-20231031T125637/results/*.log]
E1031 13:16:15.346641   40204 ssh.go:149] failed to run SSH command: out: ls: cannot access 'core@35.185.108.51:/tmp/node-e2e-20231031T125637/results/*.log': No such file or directory
, err: exit status 2
```
* This change fixes the above issue and helps in gathering the required test artifacts once the tests execution is completed

Signed-off-by: Sai Ramesh Vanka <svanka@redhat.com>
2023-10-31 15:36:39 +05:30
Sascha Grunert
7933368460
Update CNI plugins to v1.3.0
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-08-17 09:50:53 +02:00
upodroid
a65d207507 calculate the correct machine-type 2023-07-26 23:10:06 +00:00
upodroid
7d13c9b096 set map to nil if an empty string is passed 2023-07-26 10:32:27 +03:00
upodroid
1c99f9591b add node-env and instance-type flags to node-e2e tests 2023-07-21 21:46:37 +00:00
Davanum Srinivas
b01a4145b2
Install ecr-credential-provider during node e2e tests
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-06-30 09:18:44 -04:00
Davanum Srinivas
f96d83af66
Copy container logs for easier debugging
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-06-29 11:56:00 -04:00
Davanum Srinivas
0ef1f2f2d8
Set AWS specific credential provider when running there
NOTE: we are not installing the ecr-credential-provider binary
itself here we are, we need to do it out-of-band from the test
suite itself before it runs.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-06-27 07:45:59 -04:00
Ike Ma
e21cf9a54e Setup e2e_node to support testing on ARM64
* Enable dockerized build with --use-dockerized-build=true
* Build and create test artifacts for ARM64 with --target-build-arch=arm64
* Prepull multi-arch ready container image
* Download ARM64 binaries/packages if running on ARM64 machine
2023-05-20 00:07:44 +00:00
Kubernetes Prow Robot
dd43d864c1
Merge pull request #116901 from pacoxu/cleanup-KubeletCredentialProviders
remove GAed KubeletCredentialProviders (1.28)
2023-05-08 07:55:53 -07:00
Davanum Srinivas
bda73bd112
Refactor remote runners
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-04-02 16:51:39 -04:00