Removed Python 2 and Python 3.5- support

Deprecation of Python versions below 3.6 gives opportunity to unify the
build and install requirements for OpenZFS packages. The minimal
supported Python version is 3.6 as this is the most recent Python
package CentOS/RHEL 7 users can get.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Closes #12925
This commit is contained in:
Damian Szuberski
2022-01-13 17:51:12 +01:00
committed by GitHub
parent da9c6c0333
commit 8a7c4efd3c
20 changed files with 66 additions and 1320 deletions
+3 -11
View File
@@ -15,19 +15,14 @@
# Copyright (c) 2012, 2018 by Delphix. All rights reserved.
# Copyright (c) 2019 Datto Inc.
#
# This script must remain compatible with Python 2.6+ and Python 3.4+.
# This script must remain compatible with Python 3.6+.
#
# some python 2.7 system don't have a configparser shim
try:
import configparser
except ImportError:
import ConfigParser as configparser
import os
import sys
import ctypes
import re
import configparser
from datetime import datetime
from optparse import OptionParser
@@ -37,7 +32,7 @@ from select import select
from subprocess import PIPE
from subprocess import Popen
from threading import Timer
from time import time
from time import time, CLOCK_MONOTONIC_RAW
BASEDIR = '/var/tmp/test_results'
TESTDIR = '/usr/share/zfs/'
@@ -49,9 +44,6 @@ LOG_OUT = 'LOG_OUT'
LOG_ERR = 'LOG_ERR'
LOG_FILE_OBJ = None
# some python 2.7 system don't have a concept of monotonic time
CLOCK_MONOTONIC_RAW = 4 # see <linux/time.h>
class timespec(ctypes.Structure):
_fields_ = [
+5 -5
View File
@@ -15,7 +15,7 @@
# Copyright (c) 2017 by Delphix. All rights reserved.
# Copyright (c) 2018 by Lawrence Livermore National Security, LLC.
#
# This script must remain compatible with Python 2.6+ and Python 3.4+.
# This script must remain compatible with Python 3.6+.
#
import os
@@ -62,13 +62,13 @@ known_reason = 'Known issue'
exec_reason = 'Test user execute permissions required for utilities'
#
# Some tests require a minimum python version of 3.5 and will be skipped when
# Some tests require a minimum python version of 3.6 and will be skipped when
# the default system version is too old. There may also be tests which require
# additional python modules be installed, for example python-cffi is required
# additional python modules be installed, for example python3-cffi is required
# by the pyzfs tests.
#
python_reason = 'Python v3.5 or newer required'
python_deps_reason = 'Python modules missing: python-cffi'
python_reason = 'Python v3.6 or newer required'
python_deps_reason = 'Python modules missing: python3-cffi'
#
# Some tests require the O_TMPFILE flag which was first introduced in the
-2
View File
@@ -71,8 +71,6 @@ export SYSTEM_FILES_COMMON='arp
printf
ps
pwd
python
python2
python3
quotaon
readlink
@@ -92,27 +92,13 @@ typeset -a pos_cmds_out=(
}
}")
#
# N.B. json.tool is needed to guarantee consistent ordering of fields,
# sed is needed to trim trailing space in CentOS 6's json.tool output
#
# As of Python 3.5 the behavior of json.tool changed to keep the order
# the same as the input and the --sort-keys option was added. Detect when
# --sort-keys is supported and apply the option to ensure the expected order.
#
if python -m json.tool --sort-keys <<< "{}"; then
JSON_TOOL_CMD="python -m json.tool --sort-keys"
else
JSON_TOOL_CMD="python -m json.tool"
fi
typeset -i cnt=0
typeset cmd
for cmd in ${pos_cmds[@]}; do
log_must zfs program $TESTPOOL $TESTZCP $TESTDS $cmd 2>&1
log_must zfs program -j $TESTPOOL $TESTZCP $TESTDS $cmd 2>&1
OUTPUT=$(zfs program -j $TESTPOOL $TESTZCP $TESTDS $cmd 2>&1 |
$JSON_TOOL_CMD | sed 's/[[:space:]]*$//')
python3 -m json.tool --sort-keys)
if [ "$OUTPUT" != "${pos_cmds_out[$cnt]}" ]; then
log_note "Got :$OUTPUT"
log_note "Expected:${pos_cmds_out[$cnt]}"
@@ -30,7 +30,7 @@ verify_runnable "global"
# Verify that the required dependencies for testing are installed.
@PYTHON@ -c "import cffi" 2>/dev/null
if [ $? -eq 1 ]; then
log_unsupported "python-cffi not found by Python"
log_unsupported "python3-cffi not found by Python"
fi
# We don't just try to "import libzfs_core" because we want to skip these tests
@@ -87,7 +87,7 @@ log_must xattrtest -f 10 -x 3 -s 32768 -r -k -p /$TESTPOOL/$TESTFS2/xattrsadir
# OpenZFS issue #7432
log_must zfs set compression=on xattr=sa $TESTPOOL/$TESTFS2
log_must touch /$TESTPOOL/$TESTFS2/attrs
log_must eval "python -c 'print \"a\" * 4096' | \
log_must eval "python3 -c 'print \"a\" * 4096' | \
set_xattr_stdin bigval /$TESTPOOL/$TESTFS2/attrs"
log_must zfs set compression=off xattr=on $TESTPOOL/$TESTFS2
@@ -88,7 +88,7 @@ log_must zfs snapshot $POOL/fs@c
# 4. Create an empty file and add xattrs to it to exercise reclaiming a
# dnode that requires more than 1 slot for its bonus buffer (Zol #7433)
log_must zfs set compression=on xattr=sa $POOL/fs
log_must eval "python -c 'print \"a\" * 512' |
log_must eval "python3 -c 'print \"a\" * 512' |
set_xattr_stdin bigval /$POOL/fs/attrs"
log_must zfs snapshot $POOL/fs@d