]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs/154: migrate to python3 v2022.12.25
authorQu Wenruo <wqu@suse.com>
Fri, 23 Dec 2022 02:56:42 +0000 (10:56 +0800)
committerZorro Lang <zlang@kernel.org>
Sun, 25 Dec 2022 13:30:21 +0000 (21:30 +0800)
commit3dc46f477b39d732e1841e6f5a180759cee3e8ce
treecae18d06a3c77cf45fd88244ba233979505528d9
parent56c8f841407c29808d370d06929a3f58c7afeee3
btrfs/154: migrate to python3

Test case btrfs/154 is still using python2 script, which is already EOL.
Some rolling distros like Archlinux is no longer providing python2
package anymore.

This means btrfs/154 will be harder and harder to run.

To fix the problem, migreate the python script to python3, this involves
the following changes:

- Change common/config to use python3
- Strong type conversion between string and bytes
  This means, anything involved in the forged bytes has to be bytes.

  And there is no safe way to convert forged bytes into string, unlike
  python2.
  I guess that's why the author went python2 in the first place.

  Thankfully os.rename() still accepts forged bytes.

- Use bytes specific checks for invalid chars.

The updated script can still cause the needed conflicts, can be verified
through "btrfs ins dump-tree" command.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/config
src/btrfs_crc32c_forged_name.py
tests/btrfs/154