@@ -490,7 +490,9 @@ func (testenv *TestCaseEnv) VerifyAppFrameworkState(ctx context.Context, deploym
490490 verifyCtx , cancel := context .WithTimeout (ctx , deployment .GetTimeout ())
491491 defer cancel ()
492492
493- testenv .VerifyAppListPhase (verifyCtx , deployment , as .CrName , as .CrKind , as .CrAppSourceName , p , as .CrAppFileList )
493+ if err := testenv .VerifyAppListPhase (verifyCtx , deployment , as .CrName , as .CrKind , as .CrAppSourceName , p , as .CrAppFileList ); err != nil {
494+ errChan <- fmt .Errorf ("phase %v verification failed for CR %s/%s: %w" , p , as .CrKind , as .CrName , err )
495+ }
494496 }(appSourceItem , phase )
495497 }
496498 }
@@ -515,7 +517,9 @@ func (testenv *TestCaseEnv) VerifyAppFrameworkState(ctx context.Context, deploym
515517 for _ , appSource := range appSource {
516518 testenv .Log .Info (fmt .Sprintf ("Verify apps %s packages are deleted from the operator pod for CR %v with name %v" , appSource .CrAppVersion , appSource .CrKind , appSource .CrName ))
517519 opPath := filepath .Join (splcommon .AppDownloadVolume , "downloadedApps" , testenv .GetName (), appSource .CrKind , deployment .GetName (), appSource .CrAppScope , appSource .CrAppSourceName )
518- testenv .VerifyAppsPackageDeletedOnOperatorContainer (ctx , deployment , []string {opPod }, appSource .CrAppFileList , opPath )
520+ if err := testenv .VerifyAppsPackageDeletedOnOperatorContainer (ctx , deployment , []string {opPod }, appSource .CrAppFileList , opPath ); err != nil {
521+ return "" , fmt .Errorf ("apps packages not deleted from operator pod for CR %s/%s: %w" , appSource .CrKind , appSource .CrName , err )
522+ }
519523 }
520524
521525 // Verify apps 'install' state for all CRs IN PARALLEL
@@ -537,7 +541,9 @@ func (testenv *TestCaseEnv) VerifyAppFrameworkState(ctx context.Context, deploym
537541 verifyCtx , cancel := context .WithTimeout (ctx , deployment .GetTimeout ())
538542 defer cancel ()
539543
540- testenv .VerifyAppListPhase (verifyCtx , deployment , as .CrName , as .CrKind , as .CrAppSourceName , enterpriseApi .PhaseInstall , as .CrAppFileList )
544+ if err := testenv .VerifyAppListPhase (verifyCtx , deployment , as .CrName , as .CrKind , as .CrAppSourceName , enterpriseApi .PhaseInstall , as .CrAppFileList ); err != nil {
545+ errChan <- fmt .Errorf ("install phase verification failed for CR %s/%s: %w" , as .CrKind , as .CrName , err )
546+ }
541547 }(appSourceItem )
542548 }
543549
@@ -561,34 +567,46 @@ func (testenv *TestCaseEnv) VerifyAppFrameworkState(ctx context.Context, deploym
561567 podDownloadPath := AppStagingLocOnPod + appSource .CrAppSourceVolumeName
562568 pod := appSource .CrPod
563569 testenv .Log .Info (fmt .Sprintf ("Verify %s apps packages are deleted on pod %s" , appSource .CrAppVersion , pod ))
564- testenv .VerifyAppsPackageDeletedOnContainer (ctx , deployment , pod , appSource .CrAppFileList , podDownloadPath )
570+ if err := testenv .VerifyAppsPackageDeletedOnContainer (ctx , deployment , pod , appSource .CrAppFileList , podDownloadPath ); err != nil {
571+ return "" , fmt .Errorf ("apps packages not deleted on pod %s for CR %s/%s: %w" , pod , appSource .CrKind , appSource .CrName , err )
572+ }
565573 }
566574
567575 // Verify bundle push status
568576 for _ , appSource := range appSource {
569577 if (appSource .CrKind == "ClusterManager" || appSource .CrKind == "ClusterMaster" ) && appSource .CrAppScope == enterpriseApi .ScopeCluster {
570578 testenv .Log .Info (fmt .Sprintf ("Verify Cluster Manager bundle push status (%s apps) and compare bundle hash with previous bundle hash" , appSource .CrAppVersion ))
571- testenv .VerifyClusterManagerBundlePush (ctx , deployment , appSource .CrReplicas , clusterManagerBundleHash )
579+ if err := testenv .VerifyClusterManagerBundlePush (ctx , deployment , appSource .CrReplicas , clusterManagerBundleHash ); err != nil {
580+ return "" , fmt .Errorf ("cluster manager bundle push verification failed: %w" , err )
581+ }
572582 if clusterManagerBundleHash == "" {
573583 clusterManagerBundleHash = GetClusterManagerBundleHash (ctx , deployment , appSource .CrKind )
574584 }
575585 }
576586 if appSource .CrKind == "SearchHeadCluster" && appSource .CrAppScope == enterpriseApi .ScopeCluster {
577587 testenv .Log .Info (fmt .Sprintf ("Verify Deployer bundle push status (%s apps)" , appSource .CrAppVersion ))
578- testenv .VerifyDeployerBundlePush (ctx , deployment , testenv .GetName (), appSource .CrReplicas )
588+ if err := testenv .VerifyDeployerBundlePush (ctx , deployment , testenv .GetName (), appSource .CrReplicas ); err != nil {
589+ return "" , fmt .Errorf ("deployer bundle push verification failed: %w" , err )
590+ }
579591 }
580592 }
581593
582594 // Verify apps are copied to correct location on all CRs
583595 for _ , appSource := range appSource {
584596 if appSource .CrAppScope == enterpriseApi .ScopeLocal {
585597 testenv .Log .Info (fmt .Sprintf ("Verify %s apps with 'local' scope are copied to /etc/apps/ for CR %s with name %s" , appSource .CrAppVersion , appSource .CrKind , appSource .CrName ))
586- testenv .VerifyAppsCopied (ctx , deployment , appSource .CrPod , appSource .CrAppList , true , appSource .CrAppScope )
598+ if err := testenv .VerifyAppsCopied (ctx , deployment , appSource .CrPod , appSource .CrAppList , true , appSource .CrAppScope ); err != nil {
599+ return "" , fmt .Errorf ("local apps not copied for CR %s/%s: %w" , appSource .CrKind , appSource .CrName , err )
600+ }
587601 } else {
588602 testenv .Log .Info (fmt .Sprintf ("Verify %s apps with 'cluster' scope are NOT copied to /etc/apps/ on %v pod" , appSource .CrAppVersion , appSource .CrPod ))
589- testenv .VerifyAppsCopied (ctx , deployment , appSource .CrPod , appSource .CrAppList , false , appSource .CrAppScope )
603+ if err := testenv .VerifyAppsCopied (ctx , deployment , appSource .CrPod , appSource .CrAppList , false , appSource .CrAppScope ); err != nil {
604+ return "" , fmt .Errorf ("cluster apps unexpectedly copied to CR pod for %s/%s: %w" , appSource .CrKind , appSource .CrName , err )
605+ }
590606 testenv .Log .Info (fmt .Sprintf ("Verify %s apps with 'cluster' scope are copied on %v pods" , appSource .CrAppVersion , appSource .CrClusterPods ))
591- testenv .VerifyAppsCopied (ctx , deployment , appSource .CrClusterPods , appSource .CrAppList , true , appSource .CrAppScope )
607+ if err := testenv .VerifyAppsCopied (ctx , deployment , appSource .CrClusterPods , appSource .CrAppList , true , appSource .CrAppScope ); err != nil {
608+ return "" , fmt .Errorf ("cluster apps not copied to cluster pods for %s/%s: %w" , appSource .CrKind , appSource .CrName , err )
609+ }
592610 }
593611 }
594612
@@ -598,11 +616,15 @@ func (testenv *TestCaseEnv) VerifyAppFrameworkState(ctx context.Context, deploym
598616 checkUpdated := appSource .CrAppVersion == "V2"
599617 if appSource .CrAppScope == "local" {
600618 testenv .Log .Info (fmt .Sprintf ("Verify %s apps with 'local' scope for CR %s with name %s are installed on pod %s" , appSource .CrAppVersion , appSource .CrKind , appSource .CrName , allPodNames ))
601- testenv .VerifyAppInstalled (ctx , deployment , testenv .GetName (), allPodNames , appSource .CrAppList , true , "enabled" , checkUpdated , false )
619+ if err := testenv .VerifyAppInstalled (ctx , deployment , testenv .GetName (), allPodNames , appSource .CrAppList , true , "enabled" , checkUpdated , false ); err != nil {
620+ return "" , fmt .Errorf ("local apps not installed for CR %s/%s: %w" , appSource .CrKind , appSource .CrName , err )
621+ }
602622 } else {
603623 allPodNames = appSource .CrClusterPods
604624 testenv .Log .Info (fmt .Sprintf ("Verify %s apps with 'cluster' scope for CR %s with name %s are installed on pods %s" , appSource .CrAppVersion , appSource .CrKind , appSource .CrName , allPodNames ))
605- testenv .VerifyAppInstalled (ctx , deployment , testenv .GetName (), allPodNames , appSource .CrAppList , true , "enabled" , checkUpdated , true )
625+ if err := testenv .VerifyAppInstalled (ctx , deployment , testenv .GetName (), allPodNames , appSource .CrAppList , true , "enabled" , checkUpdated , true ); err != nil {
626+ return "" , fmt .Errorf ("cluster apps not installed for CR %s/%s: %w" , appSource .CrKind , appSource .CrName , err )
627+ }
606628 }
607629 }
608630 return clusterManagerBundleHash , nil
0 commit comments