mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-04-28 19:37:01 +00:00
Merge pull request #9565 from hollycai05/add-e2e-tests-for-PR9452
Add e2e test case for PR 9452
This commit is contained in:
@@ -77,6 +77,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",
|
||||
})
|
||||
@@ -247,6 +255,16 @@ func (n *NodeAgentConfigTestCase) Backup() error {
|
||||
// but we can verify if the expected affinity is contained in the pod affinity.
|
||||
Expect(backupPodList.Items[0].Spec.Affinity.String()).To(ContainSubstring(expectedLabelKey))
|
||||
|
||||
// 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) {
|
||||
@@ -328,6 +346,16 @@ func (n *NodeAgentConfigTestCase) Restore() error {
|
||||
// but we can verify if the expected affinity is contained in the pod affinity.
|
||||
Expect(restorePodList.Items[0].Spec.Affinity.String()).To(ContainSubstring(expectedLabelKey))
|
||||
|
||||
// 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) {
|
||||
|
||||
Reference in New Issue
Block a user