Add e2e test case for PR 9452

Signed-off-by: dongqingcc <dongqingcc@vmware.com>
This commit is contained in:
dongqingcc
2026-03-06 13:38:56 +08:00
parent 55737b9cf1
commit 1c9c669fa0
@@ -78,6 +78,14 @@ var LoadAffinities func() = TestFunc(&NodeAgentConfigTestCase{
IgnoreDelayBinding: true,
},
PriorityClassName: test.PriorityClassNameForDataMover,
// Explicitly add custom labels and annotations to be tested
PodLabels: map[string]string{
"spectrocloud.com/connection": "proxy", // Tests appending custom labels (Issue #9435)
"azure.workload.identity/use": "true", // Tests overwriting built-in labels
},
PodAnnotations: map[string]string{
"test-data-mover-annotation": "true",
},
},
nodeAgentConfigMapName: "node-agent-config",
})
@@ -244,6 +252,16 @@ func (n *NodeAgentConfigTestCase) Backup() error {
Expect(backupPodList.Items[0].Spec.Affinity).To(Equal(expectedAffinity))
// Verify PodLabels
for k, v := range n.nodeAgentConfigs.PodLabels {
Expect(backupPodList.Items[0].Labels[k]).To(Equal(v))
}
// Verify PodAnnotations
for k, v := range n.nodeAgentConfigs.PodAnnotations {
Expect(backupPodList.Items[0].Annotations[k]).To(Equal(v))
}
fmt.Println("backupPod content verification completed successfully.")
wait.PollUntilContextTimeout(n.Ctx, 5*time.Second, 5*time.Minute, true, func(ctx context.Context) (bool, error) {
@@ -321,6 +339,16 @@ func (n *NodeAgentConfigTestCase) Restore() error {
Expect(restorePodList.Items[0].Spec.Affinity).To(Equal(expectedAffinity))
// Verify PodLabels
for k, v := range n.nodeAgentConfigs.PodLabels {
Expect(restorePodList.Items[0].Labels[k]).To(Equal(v))
}
// Verify PodAnnotations
for k, v := range n.nodeAgentConfigs.PodAnnotations {
Expect(restorePodList.Items[0].Annotations[k]).To(Equal(v))
}
fmt.Println("restorePod content verification completed successfully.")
wait.PollUntilContextTimeout(n.Ctx, 5*time.Second, 5*time.Minute, true, func(ctx context.Context) (bool, error) {