make: remove checks for python 2 binary

This commit removes the checks for the Python 2 binary in the makefile
and makes sure that ZDTM tests always use python3. Since support for
Python 2 has been dropped, these checks are no longer needed.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
Radostin Stoyanov 2023-06-22 00:06:53 +01:00 committed by Andrei Vagin
parent 642fd99bfd
commit ede018176c
32 changed files with 31 additions and 44 deletions

View file

@ -12,11 +12,9 @@ endif
FOOTER := footer.txt
SRC1 += crit.txt
ifeq ($(PYTHON),python3)
SRC1 += criu-ns.txt
endif
SRC1 += compel.txt
SRC1 += criu-amdgpu-plugin.txt
SRC1 += criu-amdgpu-plugin.txt
SRC8 += criu.txt
SRC := $(SRC1) $(SRC8)
XMLS := $(patsubst %.txt,%.xml,$(SRC))

View file

@ -145,10 +145,8 @@ install: $(obj)/criu
$(Q) install -m 644 $(UAPI_HEADERS) $(DESTDIR)$(INCLUDEDIR)/criu/
$(Q) mkdir -p $(DESTDIR)$(LIBEXECDIR)/criu/scripts
$(Q) install -m 755 scripts/systemd-autofs-restart.sh $(DESTDIR)$(LIBEXECDIR)/criu/scripts
ifeq ($(PYTHON),python3)
$(E) " INSTALL " scripts/criu-ns
$(Q) install -m 755 scripts/criu-ns $(DESTDIR)$(SBINDIR)
endif
.PHONY: install
uninstall:

View file

@ -20,13 +20,10 @@ REQ-DEB-PKG-NAMES += libcap-dev
REQ-DEB-PKG-TEST-NAMES += $(PYTHON)-yaml
REQ-DEB-PKG-TEST-NAMES += libaio-dev
ifeq ($(PYTHON),python3)
REQ-DEB-PKG-TEST-NAMES += libaio-dev
REQ-RPM-PKG-TEST-NAMES += $(PYTHON)-PyYAML
else
REQ-RPM-PKG-TEST-NAMES += $(PYTHON)-pyyaml
endif
export LIBS += -lprotobuf-c -ldl -lnl-3 -lsoccr -Lsoccr/ -lnet

View file

@ -27,7 +27,6 @@ RUN apt-install \
pkg-config \
protobuf-c-compiler \
protobuf-compiler \
python-is-python3 \
python3-minimal \
python3-protobuf \
python3-yaml

View file

@ -58,10 +58,6 @@ ci_prep () {
scripts/ci/apt-install "${CI_PKGS[@]}"
chmod a+x "$HOME"
# zdtm uses an unversioned python binary to run the tests.
# let's point python to python3
ln -sf /usr/bin/python3 /usr/bin/python
}
test_stream() {

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import ctypes
import ctypes.util
import errno

View file

@ -1,4 +1,4 @@
#!/bin/env python2
#!/bin/env python3
import sys

View file

@ -23,7 +23,7 @@ MAKE := make
MKDIR := mkdir -p
AWK := awk
PERL := perl
FULL_PYTHON := $(shell which python3 2>/dev/null || which python2 2>/dev/null)
FULL_PYTHON := $(shell which python3 2>/dev/null)
PYTHON ?= $(shell basename $(FULL_PYTHON))
FIND := find
SH := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \

View file

@ -21,7 +21,6 @@ tcp-conn-v6: tcp-conn-v6.c
test: tcp-constructor tcp-conn tcp-conn-v6
unshare -n sh -c "ip link set up dev lo; ./tcp-conn"
unshare -n sh -c "ip link set up dev lo; ./tcp-conn-v6"
python run.py ./$(RUN)
python3 run.py ./$(RUN)
.PHONY: test

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys, os
import hashlib

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import os

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import pycriu
import sys
import os

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import argparse
import os

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import os

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import ctypes
libc = ctypes.CDLL(None)

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import fcntl
import os

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import subprocess
import os, sys, time, signal, pty

View file

@ -2,7 +2,7 @@
set -e -x
# construct root
python ../../zdtm.py run -t zdtm/static/env00 --iter 0 -f ns
python3 ../../zdtm.py run -t zdtm/static/env00 --iter 0 -f ns
truncate -s 0 zdtm.loop
truncate -s 50M zdtm.loop
@ -11,7 +11,7 @@ dev=`losetup --find --show zdtm.loop`
mkdir -p ../../dev
cp -ap $dev ../../dev
export ZDTM_MNT_EXT_DEV=$dev
python ../../zdtm.py run $EXTRA_OPTS -t zdtm/static/mnt_ext_dev || ret=$?
python3 ../../zdtm.py run $EXTRA_OPTS -t zdtm/static/mnt_ext_dev || ret=$?
losetup -d $dev
unlink zdtm.loop
exit $ret

View file

@ -20,7 +20,7 @@ for i in `awk '{ print $2 }' < /proc/self/mounts`; do
umount -l $i
done
python mounts.py
python3 mounts.py
kill $INMNTNS_PID
while :; do
sleep 10

View file

@ -4,7 +4,7 @@ all: test-c rpc_pb2.py criu
CFLAGS += -g -Werror -Wall -I.
LDLIBS += -lprotobuf-c
PYTHON ?= python
PYTHON ?= python3
run: all
@make -C .. loop

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
import argparse
import os

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# Test criu errno
import socket, os, errno

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
import socket, os, sys, errno
import rpc_pb2 as rpc

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
import socket, os, sys
import rpc_pb2 as rpc

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
import socket, os, sys
import rpc_pb2 as rpc

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
import sys
import rpc_pb2 as rpc

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os, pty, sys, subprocess
import termios, fcntl, time

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import os

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import fcntl
import tempfile
import struct

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import socket
import time

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import subprocess
import socket

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
sys.path.append("../crit")