Commit graph

16 commits

Author SHA1 Message Date
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
Todd Neal
23f71f0eba refactor remote test running 2023-03-12 21:26:01 -05:00
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
shuheiktgw
79484ed7b6 Check key existence in the getPrivateSSHKey function 2021-11-27 15:00:24 +09:00
shuheiktgw
db4a743b77 Check the private SSH key existence in the node e2e tests 2021-11-23 17:20:42 +09:00
Namanl2001
85d16760f0
adding defaultGceKey in remote/ssh.go
Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
2021-10-19 00:07:36 +05:30
Artyom Lukianov
93ff47b05b e2e node: make possible to add additional kernel arguments
Add an option to configure additional kernel arguments during
the setup of e2e node environment.

The example:
cos-stable1:
image_family: cos-89-lts # docker v19.03.6, deprecated after 2021-06-24
project: cos-cloud
metadata: "user-data<test/e2e_node/jenkins/cos-init-live-restore.yaml,gci-update-strategy=update_disabled"
kernel_arguments:
- "numa=fake=2"
machine: n1-standard-4

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-05-11 13:49:32 +03:00
Harshal Patil
9d5ca30b76 Read ssh username from env variable
Signed-off-by: Harshal Patil <harpatil@redhat.com>
2020-08-17 17:49:26 +05:30
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
SataQiu
69aae3aa5a fix golint failures of test/e2e_node/remote 2019-11-29 18:11:55 +08:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Jeff Grafton
30a5efa33b Add flag to node e2e test specifying location of ssh privkey 2016-12-21 11:52:41 -08:00
Random-Liu
10f72be5af Support set user with --ssh-user flag when running remote node e2e. 2016-12-21 01:54:02 -08:00
Random-Liu
6f92572209 Move ssh related functions into ssh.go. 2016-12-05 23:59:58 -08:00