Fix failing nightly test

This commit is contained in:
Abin Simon 2023-10-17 17:14:53 +05:30
parent f64e2fe875
commit 9a647aa422
3 changed files with 17 additions and 2 deletions

View File

@ -43,6 +43,10 @@ func GetRestoreResource(
} }
if len(rc.ProtectedResource) == 0 { if len(rc.ProtectedResource) == 0 {
if len(rc.SubService.ID) == 0 {
return path.UnknownService, nil, errors.New("missing subservice id for restore")
}
pr, err := res.GetResourceIDAndNameFrom(ctx, rc.SubService.ID, ins) pr, err := res.GetResourceIDAndNameFrom(ctx, rc.SubService.ID, ins)
if err != nil { if err != nil {
return path.UnknownService, nil, clues.Wrap(err, "identifying resource owner") return path.UnknownService, nil, clues.Wrap(err, "identifying resource owner")

View File

@ -239,5 +239,5 @@ func (suite *GroupsRestoreNightlyIntgSuite) TestRestore_Run_groupsAlternateProte
sel.Selector, sel.Selector,
suite.its.group.RootSite, suite.its.group.RootSite,
suite.its.secondaryGroup.RootSite, suite.its.secondaryGroup.RootSite,
suite.its.secondaryGroup.ID) suite.its.secondaryGroup.RootSite.ID)
} }

View File

@ -1050,6 +1050,12 @@ func runDriveRestoreWithAdvancedOptions(
acd = ac.Drives() acd = ac.Drives()
) )
// Groups restore needs subservice information
if sel.Service == selectors.ServiceGroups {
restoreCfg.SubService.Type = path.SharePointService
restoreCfg.SubService.ID = driveID
}
// initial restore // initial restore
suite.Run("baseline", func() { suite.Run("baseline", func() {
@ -1320,8 +1326,13 @@ func runDriveRestoreToAlternateProtectedResource(
acd = ac.Drives() acd = ac.Drives()
) )
// first restore to the 'from' resource // Groups restore needs subservice information
if sel.Service == selectors.ServiceGroups {
restoreCfg.SubService.Type = path.SharePointService
restoreCfg.SubService.ID = driveFrom.ID
}
// first restore to the 'from' resource
suite.Run("restore original resource", func() { suite.Run("restore original resource", func() {
mb = evmock.NewBus() mb = evmock.NewBus()
fromCtr := count.New() fromCtr := count.New()