[Sanity test]- skip owner permission in onedrive restore check (#3103)

<!-- PR description-->

for Sanity test - skip owner permission in onedrive restore check

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [ ]  No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic
words" - "closes, fixes" to auto-close the Github issue. -->
* https://github.com/alcionai/corso/issues/3081

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
neha_gupta 2023-04-12 20:21:15 +05:30 committed by GitHub
parent b1606466c2
commit 51b3f25311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions

View File

@ -51,6 +51,8 @@ jobs:
- run: mkdir test_results
- run: mkdir testlog
# run the tests
- name: Version Test
run: |

View File

@ -354,7 +354,7 @@ func checkOnedriveRestoration(
getRestoreData(ctx, client, *drive.GetId(), restoreFolderID, restoreFile, restoreFolderPermission, startTime)
for folderName, permissions := range folderPermission {
logger.Ctx(ctx).Info("checking for folder: %s \n", folderName)
logger.Ctx(ctx).Info("checking for folder: ", folderName, "\n")
fmt.Printf("checking for folder: %s \n", folderName)
restoreFolderPerm := restoreFolderPermission[folderName]
@ -488,17 +488,24 @@ func permissionIn(
}
var (
gv2 = perm.GetGrantedToV2()
perInfo = permissionInfo{}
gv2 = perm.GetGrantedToV2()
perInfo = permissionInfo{}
entityID string
)
if gv2.GetUser() != nil {
perInfo.entityID = ptr.Val(gv2.GetUser().GetId())
entityID = ptr.Val(gv2.GetUser().GetId())
} else if gv2.GetGroup() != nil {
perInfo.entityID = ptr.Val(gv2.GetGroup().GetId())
entityID = ptr.Val(gv2.GetGroup().GetId())
}
perInfo.roles = perm.GetRoles()
roles := perm.GetRoles()
for _, role := range roles {
if role != "owner" {
perInfo.entityID = entityID
perInfo.roles = append(perInfo.roles, role)
}
}
slices.Sort(perInfo.roles)