Skip to content

Commit 950f91f

Browse files
sayak-redhatSuper UserSAYAK DASlunarwhite
authored
SPIRE-380 : Add e2e tests for CreateOnlyMode, UpgradeableCondition, and LabelPropagation (#91)
* Add e2e tests for CreateOnlyMode, UpgradeableCondition, and LabelPropagation This PR adds comprehensive e2e test coverage for three features: ## CreateOnlyMode Tests (PContext - Pending) Tests for CREATE_ONLY_MODE environment variable handling: - Baseline (no env var set) - CREATE_ONLY_MODE=true/false (lowercase) - CREATE_ONLY_MODE=TRUE/FALSE (uppercase, case-insensitive) - Invalid and empty string values - Env var removal transition **Note:** These tests are marked as PContext (pending/skipped) due to an operator bug where the CreateOnlyMode condition does not transition from True to False when the CREATE_ONLY_MODE env var is set to 'false' or removed. The condition remains stuck at True. Tests will be enabled once the operator bug is fixes available in the build ## UpgradeableCondition Tests Tests for OLM Upgradeable condition management: - Upgradeable=True when all operands are ready - Upgradeable=False when pods are deleted (SpireServer, SpireAgent, OIDC) - Recovery to Upgradeable=True after pod restoration - Multiple concurrent pod failures handling - Operator restart recovery - Condition field verification (type, status, reason, message) ## LabelPropagation Tests Tests for spec.labels propagation to workload metadata: - SpireServer → StatefulSet metadata.labels - SpireAgent → DaemonSet metadata.labels - SpiffeCSIDriver → DaemonSet metadata.labels - SpireOIDCDiscoveryProvider → Deployment metadata.labels - Label removal verification (clearing spec.labels) ## Utils Refactoring - Simplified containsAny() using strings.Contains - Extracted common verifyWorkloadLabel() helper to reduce duplication - Added WaitForDaemonSetLabelAbsent() helper for label removal tests - Added condition helpers: GetConditionByType, WaitForConditionStatus, WaitForConditionAbsent - Added OperatorCondition helpers for Upgradeable condition checks - Added label verification helpers for StatefulSet, DaemonSet, Deployment ## New Constants - CreateOnlyMode condition constants - UpgradeableCondition constants - Label propagation test constants * update the revome subcription config * Incorporate review comments Signed-off-by: Yuedong Wu <dwcn22@outlook.com> --------- Signed-off-by: Yuedong Wu <dwcn22@outlook.com> Co-authored-by: Super User <root@sayadas-thinkpadp16vgen1.bengluru.csb> Co-authored-by: SAYAK DAS <sayadas@sayadas-thinkpadp16vgen1.bengluru.csb> Co-authored-by: Yuedong Wu <dwcn22@outlook.com>
1 parent 1d1f1b2 commit 950f91f

3 files changed

Lines changed: 576 additions & 131 deletions

File tree

0 commit comments

Comments
 (0)