Commit Graph

56 Commits

Author SHA1 Message Date
Justin SB
50a025acdb e2e: Remove dead code in tests
We were building a local pod variable that we were no longer using.

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>
2023-03-01 08:08:33 -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
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
Ang Gao
3540f948e9 Update method name to make it more explicit 2022-12-12 21:50:07 +00:00
Ang Gao
1931494333 make GetSubnetPrefix IP family agnostic 2022-12-12 01:26:42 +00:00
Patrick Ohly
5614a9d064 e2e framework: eliminate interim sub packages
The "todo" packages were necessary while moving code around to avoid hitting
cyclic dependencies. Now that any sub package can depend on the framework, they
are no longer needed and the code can be moved into the normal sub packages.
2022-10-06 08:16:47 +02:00
Patrick Ohly
2d21acb1be e2e framework: eliminate redundant framework/[log|ginkgowrapper]
These sub packages were created by mistake. Logging and failure handling are
core features and must be implemented in the framework package.
2022-10-06 08:16:47 +02: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
Zhecheng Li
b4a3750912 [e2e][azure] Make internalStaticIP flexible
Now, internalStaticIP is hard-coded to "10.240.11.11". Such IP works
for aks-engine cluster but not for CAPZ ones (node-subnet 10.1.0.0/16)

Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
2022-04-15 10:08:36 +08:00
Jan Safranek
4efc9a9569 Fix zone calculation - consider only untainted nodes
Tests "Multi-AZ Cluster Volumes" should consider only nodes that are
schedulable and *untainted* when computing AZ where to run the tests.

GetReadySchedulableNodes() already filters schedulable + untainted nodes,
no need to do it again in GetSchedulableClusterZones().
2021-08-03 14:41:12 +02:00
ravisantoshgudimetla
67bc23411b [storage] [test] Ensure proper resource creation
Ensure resources are created in zone with schedulable
nodes. For example, if we have 4 zones with 3 zones
having worker nodes and 1 zone having master nodes(unscheduable
for workloads), we should not create resources like PV, PVC or
pods in that zone.
2021-06-30 18:01:57 -04:00
Mike Dame
cc1eab1ca2 Move deferred taint cleanup call to ensure all are removed 2021-01-29 10:17:21 -05:00
Antonio Ojea
ad043f2bdd e2e dualstack test fixes
remove unused variables and fix comments
2020-11-16 23:18:30 +01:00
Antonio Ojea
ed694a1bf6 add e2e test for dual-stack secondary service IPs
Dual stack services can have two ClusterIPs, we already have tests that
exercise the connectivity from different scenarios to the first
ClusterIP of the service.

This PR adds a new functionality to the e2e network utils to enable
DualStack services, and replicate the same tests but using the
secondary ClusterIP, so we cover the connectivity to both cluster IPs.
2020-11-12 10:07:04 +01:00
Kubernetes Prow Robot
7e62b1cab8
Merge pull request #96122 from cmluciano/cml/dualstackudpnode
dualstack: use correct IPFamily list for conntrack checks in e2e
2020-11-10 17:51:40 -08:00
Christopher M. Luciano
fa7a802d55
dualstack: use correct IPFamily list for conntrack checks in e2e
We hardcode the index number in the KubeProxy/Conntrack e2es and
CollectAddresses returns 4 mixed IP Family addresses in a dualstack
cluster. This change ensures that the serverNodeInfo.nodeIP has only
valid addresses for the expected IPFamily per test case.

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2020-11-10 15:02:29 -05: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
tanjunchen
818238ae74 test/e2e/framework/:use the term 'Control Plane' in comment 2020-10-02 08:54:29 -07:00
Kenichi Omichi
029b2d2197 Remove DeprecatedMightBeMasterNode()
This removes DeprecatedGetMasterAndWorkerNodes() usage from vsphere e2e
test as deprecated function cleanup.
Then all callers of DeprecatedMightBeMasterNode() have been removed.
So this removes DeprecatedMightBeMasterNode() itself also.
2020-07-11 03:18:44 +00:00
Kenichi Omichi
5edf15ea97 Use worker nodes for WaitForStableCluster()
WaitForStableCluster() checks all pods run on worker nodes, and the
function used to refer master nodes to skip checking controller plane
pods.
GetMasterAndWorkerNodes() was used for getting master nodes, but the
implementation is not good because it usesDeprecatedMightBeMasterNode().

This makes WaitForStableCluster() refer worker nodes directly to avoid
using GetMasterAndWorkerNodes().
2020-06-24 15:21:12 +00:00
Kenichi Omichi
13aae61789 Add isNodeSchedulableWithoutTainted()
For reducing usage of system.DeprecatedMightBeMasterNode(), this
adds isNodeSchedulableWithoutTainted().
2020-06-24 01:58:04 +00:00
tanjunchen
caddb3ffd3 test/e2e/framework:remove the direct dependency for k8s.io/kubernetes/pkg 2020-04-30 23:08:33 +08:00
tanjunchen
3b5ea194ea test/e2e/framework : move AddOrUpdateTaintOnNode to subpackage node 2020-04-29 21:29:38 +08:00
tanjunchen
87f2ef51f4 test/e2e/framework:remove direct k8s.io/kubernetes depedencies 2020-04-15 09:39:22 +08:00
Abdullah Gharaibeh
bed9b2f23b Cleanup obsolete NodeInfo methods 2020-04-12 18:13:46 -04:00
tanjunchen
6532b40f21 move function RemoveTaintOffNode in test/e2e/framework/util.go to subpackage node 2020-04-08 09:59:44 +08:00
Abdullah Gharaibeh
a5d8172715 move nodeinfo type to framework pkg 2020-04-07 10:25:24 -04:00
Abdullah Gharaibeh
ed3fe054df move scheduler nodeinfo to pkg/scheduler/types 2020-03-31 21:02:09 -04:00
Kubernetes Prow Robot
cc06d2a2be
Merge pull request #89243 from SataQiu/staging-e2e-framework-20200319
e2e/framework: remove direct imports to /pkg/controller/nodelifecycle
2020-03-23 21:56:47 -07:00
SataQiu
799cdbf7b0 e2e/framework: remove direct imports to /pkg/controller/nodelifecycle 2020-03-21 11:08:57 +08:00
drfish
f5450543e0 Remove framework.go's dependency on e2e node sub fw 2020-03-20 10:01:51 +08:00
Kubernetes Prow Robot
6d67bb3c02
Merge pull request #89228 from andrewsykim/e2e-framework-v1-helper
e2e/framework: remove import to pkg/apis/core/v1/helper
2020-03-19 06:06:56 -07:00
Andrew Sy Kim
145c1c123c e2e/framework: remove import to pkg/apis/core/v1/helper
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-03-18 13:18:39 -04:00
Kenichi Omichi
c586d8837a Move GetClusterZones() to e2enode 2020-03-10 18:16:54 +00:00
tanjunchen
7c3f6fa323 test/e2e/framework/node/:remove TODO and make some functions private 2020-02-21 18:45:09 +08:00
tanjunchen
efec7e64ce remove TODO and use framework.SingleCallTimeout 2020-02-14 01:12:46 +08:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
drfish
1461d8bd13 Move GetPortURL to ingress e2e fw 2020-01-24 14:17:10 +08:00
Kubernetes Prow Robot
b9c0aa0b2a
Merge pull request #86782 from tanjunchen/remove-TODO-test/e2e/framework/node/resource
remove TODO in test/e2e/framework/node/resource.go
2020-01-09 09:17:58 -08:00
Abdullah Gharaibeh
21202b08d4 remove e2e dependency on scheduler/predicates package 2020-01-08 17:24:42 -05:00
tanjunchen
9324664330 remove TODO in test/e2e/framework/node/resource.go 2020-01-02 21:55:58 +08:00
tanjunchen
488b94767c remove TODO: Use return type string instead of []string and update func 2019-12-27 11:53:17 +08:00
Antonio Ojea
5e6eb467ac
Allow ipv6 urls in GetPortURL() 2019-09-30 20:32:36 +02:00
Dan Winship
ec4c1a1c05 Add e2enode.GetRandomReadySchedulableNode, replace some uses of framework.GetReadySchedulableNodesOrDie
For tests that want a single ready, schedulable node
2019-09-24 13:03:40 -04:00
Dan Winship
3c445b2ad0 Add e2enode.GetBoundedReadySchedulableNodes, replace some uses of framework.GetReadySchedulableNodesOrDie
For tests that want at-most-N nodes
2019-09-24 13:03:40 -04:00
Dan Winship
71b02dd422 Fix up e2enode.GetReadySchedulableNodes, replace many uses of framework.GetReadySchedulableNodesOrDie
Remove the "OrDie" from the name (since it doesn't "or die") and add
an extra check that there is at least 1 node available, since many
callers already did that themselves, and many others should have.
2019-09-24 13:03:39 -04:00
John Schnake
3c53481d5c Move from regexp to csv string 2019-09-05 14:37:16 -05:00
John Schnake
8772187680 Add new flag for whitelisting node taints
Adds a new flag which allows users to specify a regexp
which will effectively whitelist certain taints and
allow the test framework to startup tests despite having
tainted nodes.

Fixes an issue where e2e tests were unable to be run
in tainted environments due to the framework waiting for
all the nodes to be schedulable without any tolerations.
2019-08-30 11:15:42 -05:00