diff options
author | Michael Felt <aixtools@users.noreply.github.com> | 2019-02-18 11:02:44 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-02-18 11:02:44 (GMT) |
commit | ef110b18074300e2302a68a2a476ae35bead7916 (patch) | |
tree | 93d81994d7ccfc3e7e02a80198957ba0768e6f90 /Lib/test/test_shutil.py | |
parent | 09fbcd6085e18b534fd4161844ff39f77eb4a082 (diff) | |
download | cpython-ef110b18074300e2302a68a2a476ae35bead7916.zip cpython-ef110b18074300e2302a68a2a476ae35bead7916.tar.gz cpython-ef110b18074300e2302a68a2a476ae35bead7916.tar.bz2 |
bpo-35704: Prevent test_shutil fail result when AIX is 32-bit and MAXDATA < 0x20000000 (GH-11500)
https://bugs.python.org/issue35704
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r-- | Lib/test/test_shutil.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index e3a0e70..86f4dc9 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -34,6 +34,7 @@ from test.support import TESTFN, FakePath TESTFN2 = TESTFN + "2" MACOS = sys.platform.startswith("darwin") +AIX = sys.platform[:3] == 'aix' try: import grp import pwd @@ -141,6 +142,17 @@ def supports_file2file_sendfile(): SUPPORTS_SENDFILE = supports_file2file_sendfile() +# AIX 32-bit mode, by default, lacks enough memory for the xz/lzma compiler test +# The AIX command 'dump -o program' gives XCOFF header information +# The second word of the last line in the maxdata value +# when 32-bit maxdata must be greater than 0x1000000 for the xz test to succeed +def _maxdataOK(): + if AIX and sys.maxsize == 2147483647: + hdrs=subprocess.getoutput("/usr/bin/dump -o %s" % sys.executable) + maxdata=hdrs.split("\n")[-1].split()[1] + return int(maxdata,16) >= 0x20000000 + else: + return True class TestShutil(unittest.TestCase): @@ -1351,6 +1363,7 @@ class TestShutil(unittest.TestCase): self.check_unpack_archive('bztar') @support.requires_lzma + @unittest.skipIf(AIX and not _maxdataOK(), "AIX MAXDATA must be 0x20000000 or larger") def test_unpack_archive_xztar(self): self.check_unpack_archive('xztar') |