Skip to content

Commit 0ee3b2f

Browse files
committed
chore(test): add pause on fail for NAT tests
Signed-off-by: Pau Capdevila <[email protected]>
1 parent d98e93e commit 0ee3b2f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pkg/hhfab/release.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2855,6 +2855,10 @@ func (testCtx *VPCPeeringTestCtx) gatewayPeeringNATTest(ctx context.Context) (bo
28552855

28562856
// Test NAT connectivity with custom function that pings correct NAT IPs
28572857
if err := testCtx.testNATGatewayConnectivity(ctx, vpc1, vpc2, vpc1NATCIDR, vpc2NATCIDR); err != nil {
2858+
if testCtx.pauseOnFail {
2859+
pauseOnFail()
2860+
}
2861+
28582862
return false, reverts, fmt.Errorf("testing NAT gateway peering connectivity: %w", err)
28592863
}
28602864

@@ -2938,6 +2942,10 @@ func (testCtx *VPCPeeringTestCtx) gatewayPeeringStatefulNATTest(ctx context.Cont
29382942
// Test stateful NAT connectivity with custom function that pings correct NAT IPs
29392943
// Note: Stateful NAT uses the same IP translation algorithm as stateless
29402944
if err := testCtx.testNATGatewayConnectivity(ctx, vpc1, vpc2, vpc1NATCIDR, vpc2NATCIDR); err != nil {
2945+
if testCtx.pauseOnFail {
2946+
pauseOnFail()
2947+
}
2948+
29412949
return false, reverts, fmt.Errorf("testing stateful NAT gateway peering connectivity: %w", err)
29422950
}
29432951

@@ -3175,6 +3183,10 @@ func (testCtx *VPCPeeringTestCtx) gatewayPeeringOverlapNATTest(ctx context.Conte
31753183

31763184
// Test connectivity using custom NAT-aware connectivity testing
31773185
if err := testCtx.testNATGatewayConnectivity(ctx, existingVPC, newVPC, existingVPCNATCIDR, newVPCNATCIDR); err != nil {
3186+
if testCtx.pauseOnFail {
3187+
pauseOnFail()
3188+
}
3189+
31783190
return false, reverts, fmt.Errorf("testing NAT gateway peering connectivity: %w", err)
31793191
}
31803192

@@ -4115,7 +4127,7 @@ func doRunTests(ctx context.Context, testCtx *VPCPeeringTestCtx, ts *JUnitTestSu
41154127
break
41164128
}
41174129
}
4118-
if !skip && err == nil && revertErr == nil {
4130+
if !skip && err == nil && revertErr == nil && ts.TestCases[i].ExpectedFail == nil {
41194131
slog.Info("PASS", "test", test.Name)
41204132
}
41214133
}

0 commit comments

Comments
 (0)