Skip to content

gh-113086: Add tests for os.chmod() and os.lchmod() #113087

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

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Dec 14, 2023

Also make test_copymode_symlink_to_symlink in test_shutil more strict.

Also make test_copymode_symlink_to_symlink in test_shutil more strict.
@serhiy-storchaka serhiy-storchaka added tests Tests in the Lib/test dir skip news needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Dec 14, 2023
@serhiy-storchaka serhiy-storchaka merged commit b4f2c89 into python:main Dec 14, 2023
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@bedevere-app
Copy link

bedevere-app bot commented Dec 14, 2023

GH-113088 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Dec 14, 2023
@bedevere-app
Copy link

bedevere-app bot commented Dec 14, 2023

GH-113089 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Dec 14, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 14, 2023
…13087)

Also make test_copymode_symlink_to_symlink in test_shutil more strict.
(cherry picked from commit b4f2c89)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 14, 2023
…13087)

Also make test_copymode_symlink_to_symlink in test_shutil more strict.
(cherry picked from commit b4f2c89)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Dec 14, 2023
GH-113088)

Also make test_copymode_symlink_to_symlink in test_shutil more strict.
(cherry picked from commit b4f2c89)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot wasm32-wasi 3.x has failed when building commit b4f2c89.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1046/builds/3741) and take a look at the build logs.
  4. Check if the failure is related to this commit (b4f2c89) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1046/builds/3741

Failed tests:

  • test_posix

Failed subtests:

  • test_chmod_file - test.test_posix.PosixTester.test_chmod_file
  • test_chmod_dir - test.test_posix.PosixTester.test_chmod_dir

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Lib/test/test_posix.py", line 970, in test_chmod_dir
    self.check_chmod(posix.chmod, target)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/test/test_posix.py", line 952, in check_chmod
    self.assertEqual(os.stat(target).st_mode, new_mode)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 16384 != 16530


Traceback (most recent call last):
  File "/Lib/test/test_posix.py", line 960, in test_chmod_file
    self.check_chmod(posix.chmod, os_helper.TESTFN)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/test/test_posix.py", line 952, in check_chmod
    self.assertEqual(os.stat(target).st_mode, new_mode)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 32768 != 32914

serhiy-storchaka added a commit that referenced this pull request Dec 14, 2023
GH-113089)

Also make test_copymode_symlink_to_symlink in test_shutil more strict.
(cherry picked from commit b4f2c89)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot wasm32-wasi 3.11 has failed when building commit e4cdb74.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1047/builds/1156) and take a look at the build logs.
  4. Check if the failure is related to this commit (e4cdb74) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1047/builds/1156

Failed tests:

  • test_posix

Failed subtests:

  • test_chmod_file - test.test_posix.PosixTester.test_chmod_file
  • test_chmod_dir - test.test_posix.PosixTester.test_chmod_dir

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Lib/test/test_posix.py", line 960, in test_chmod_file
    self.check_chmod(posix.chmod, os_helper.TESTFN)
  File "/Lib/test/test_posix.py", line 952, in check_chmod
    self.assertEqual(os.stat(target).st_mode, new_mode)
AssertionError: 32768 != 32914


Traceback (most recent call last):
  File "/Lib/test/test_posix.py", line 970, in test_chmod_dir
    self.check_chmod(posix.chmod, target)
  File "/Lib/test/test_posix.py", line 952, in check_chmod
    self.assertEqual(os.stat(target).st_mode, new_mode)
AssertionError: 16384 != 16530

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot wasm32-wasi 3.12 has failed when building commit 0bd1899.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1124/builds/532) and take a look at the build logs.
  4. Check if the failure is related to this commit (0bd1899) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1124/builds/532

Failed tests:

  • test_posix

Failed subtests:

  • test_chmod_file - test.test_posix.PosixTester.test_chmod_file
  • test_chmod_dir - test.test_posix.PosixTester.test_chmod_dir

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Lib/test/test_posix.py", line 960, in test_chmod_file
    self.check_chmod(posix.chmod, os_helper.TESTFN)
  File "/Lib/test/test_posix.py", line 952, in check_chmod
    self.assertEqual(os.stat(target).st_mode, new_mode)
AssertionError: 32768 != 32914


Traceback (most recent call last):
  File "/Lib/test/test_posix.py", line 970, in test_chmod_dir
    self.check_chmod(posix.chmod, target)
  File "/Lib/test/test_posix.py", line 952, in check_chmod
    self.assertEqual(os.stat(target).st_mode, new_mode)
AssertionError: 16384 != 16530

corona10 pushed a commit to corona10/cpython that referenced this pull request Dec 15, 2023
…13087)

Also make test_copymode_symlink_to_symlink in test_shutil more strict.
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…13087)

Also make test_copymode_symlink_to_symlink in test_shutil more strict.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…13087)

Also make test_copymode_symlink_to_symlink in test_shutil more strict.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants