-
Notifications
You must be signed in to change notification settings - Fork 5.3k
ZipFile UnixCreateSetsPermissionsInExternalAttributes test fails on Apple OSes #69583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pple OSes There are scenarios where chmod succeeds, but the OS clears certain bits, like S_ISGID and S_ISUID. When this happens, the ZipFile tests fail because the .zip file doesn't contain the expected ExternalAttributes. To fix this, read the file mode after calling chmod, and update the expected file mode so the tests still pass. Fix dotnet#68293 Fix dotnet#60581
|
Tagging subscribers to this area: @dotnet/area-system-io-compression Issue DetailsThere are scenarios where chmod succeeds, but the OS clears certain bits, like S_ISGID and S_ISUID. When this happens, the ZipFile tests fail because the .zip file doesn't contain the expected ExternalAttributes. To fix this, read the file mode after calling chmod, and update the expected file mode so the tests still pass.
|
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| string updatedPermissions = Convert.ToString(status.Mode & 0xFFF, 8); | ||
| if (updatedPermissions != permissions) | ||
| { | ||
| string newFileName = Path.Combine(folderPath, $"{updatedPermissions}.txt"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of renaming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected file mode is encoded in the file name. So the file named 755.txt expects the file mode to be 755.
See
| foreach (ZipArchiveEntry entry in archive.Entries) | |
| { | |
| Assert.EndsWith(".txt", entry.Name, StringComparison.Ordinal); | |
| EnsureExternalAttributes(entry.Name.Substring(0, entry.Name.Length - 4), entry); | |
| } |
|
IIRC this test is also disabled in 6.0, so this fix should be backported too. |
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Analyzing the failures:
None of these test failures are related to Zip file tests. So this should be good to merge. |
There are scenarios where chmod succeeds, but the OS clears certain bits, like S_ISGID and S_ISUID. When this happens, the ZipFile tests fail because the .zip file doesn't contain the expected ExternalAttributes.
To fix this, read the file mode after calling chmod, and update the expected file mode so the tests still pass.
Fix #68293
Fix #60581