From: Andreas Steffen Date: Tue, 21 Sep 2021 07:28:49 +0000 (+0200) Subject: testing: Switch to Python 3 X-Git-Tag: 5.9.4dr2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e2841572bd6f5dfd0d3641472f00eefa4d83d7a;p=thirdparty%2Fstrongswan.git testing: Switch to Python 3 Both swidGenerator and strongTNC were migrated to Python 3. This allows to migrate all testing scripts to Python 3, too. --- diff --git a/testing/scripts/build-baseimage b/testing/scripts/build-baseimage index 5814c7a6d5..10253a564a 100755 --- a/testing/scripts/build-baseimage +++ b/testing/scripts/build-baseimage @@ -19,8 +19,8 @@ INC=$INC,openssl,vim,sqlite3,conntrack,gdb,cmake,libltdl-dev,wget,gnupg,man-db INC=$INC,libboost-thread-dev,libboost-system-dev,git,iperf,htop,valgrind,strace INC=$INC,gnat,gprbuild,acpid,acpi-support-base,libldns-dev,libunbound-dev INC=$INC,dnsutils,libsoup2.4-dev,ca-certificates,unzip,libsystemd-dev -INC=$INC,python,python-setuptools,python-dev,python-pip,apt-transport-https -INC=$INC,libjson-c-dev,libxslt1-dev,libapache2-mod-wsgi,iptables-dev +INC=$INC,python3,python3-setuptools,python3-dev,python3-pip,apt-transport-https +INC=$INC,libjson-c-dev,libxslt1-dev,libapache2-mod-wsgi-py3,iptables-dev INC=$INC,libxerces-c-dev,libgcrypt20-dev,traceroute case "$BASEIMGSUITE" in jessie) diff --git a/testing/scripts/recipes/011_botan.mk b/testing/scripts/recipes/011_botan.mk index 63fb0f7de4..c923c07d4e 100644 --- a/testing/scripts/recipes/011_botan.mk +++ b/testing/scripts/recipes/011_botan.mk @@ -23,7 +23,7 @@ all: install @rm -f .$(PKG)-checkout-* && touch $@ .$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV) - cd $(PKG) && python ./configure.py $(CONFIG_OPTS) && make -j $(NUM_CPUS) + cd $(PKG) && python3 ./configure.py $(CONFIG_OPTS) && make -j $(NUM_CPUS) @rm -f .$(PKG)-built-* && touch $@ install: .$(PKG)-built-$(REV) diff --git a/testing/scripts/recipes/013_strongswan.mk b/testing/scripts/recipes/013_strongswan.mk index b4c7d3629d..0fce0ad9ff 100644 --- a/testing/scripts/recipes/013_strongswan.mk +++ b/testing/scripts/recipes/013_strongswan.mk @@ -129,6 +129,6 @@ build: configure install: build cd $(BUILDDIR) && make -j install && \ - cd $(DIR)/src/libcharon/plugins/vici/python && python setup.py install + cd $(DIR)/src/libcharon/plugins/vici/python && python3 setup.py install # for Python-based updown scripts - pip install python-daemon + pip3 install python-daemon diff --git a/testing/scripts/recipes/014_swid_generator.mk b/testing/scripts/recipes/014_swid_generator.mk index 3394620e25..f0e8c3000b 100644 --- a/testing/scripts/recipes/014_swid_generator.mk +++ b/testing/scripts/recipes/014_swid_generator.mk @@ -17,4 +17,4 @@ $(TAR): @touch $@ install: .$(PKG)-unpacked-$(REV) - cd $(DIR) && python setup.py install + cd $(DIR) && python3 setup.py install diff --git a/testing/scripts/recipes/015_strongTNC.mk b/testing/scripts/recipes/015_strongTNC.mk index b94a3114ab..973cdabef0 100644 --- a/testing/scripts/recipes/015_strongTNC.mk +++ b/testing/scripts/recipes/015_strongTNC.mk @@ -1,7 +1,7 @@ #!/usr/bin/make PKG = strongTNC -REV = 0.9.9 +REV = 1.0 DIR = $(PKG)-$(REV) ZIP = $(PKG)-$(REV).zip SRC = https://github.com/strongswan/$(PKG)/archive/$(REV).zip @@ -18,10 +18,9 @@ $(ZIP): .$(PKG)-deps-$(REV): .$(PKG)-unpacked-$(REV) mkdir -p $(DEPS) - pip download -d $(DEPS) -r $(DIR)/requirements.txt six + pip3 download -d $(DEPS) -r $(DIR)/requirements.txt @touch $@ install: .$(PKG)-deps-$(REV) - # six is required for djangorestframework-camel-case - pip install --no-index --find-links=file://`pwd`/$(DEPS) -r $(DIR)/requirements.txt six + pip3 install --no-index --find-links=file://`pwd`/$(DEPS) -r $(DIR)/requirements.txt cp -r $(DIR) /var/www/tnc && chgrp -R www-data /var/www/tnc && chmod g+sw /var/www/tnc diff --git a/testing/tests/route-based/net2net-xfrmi-ike/hosts/sun/etc/strongswan.conf b/testing/tests/route-based/net2net-xfrmi-ike/hosts/sun/etc/strongswan.conf index 283cb1d724..d5aa545b1a 100644 --- a/testing/tests/route-based/net2net-xfrmi-ike/hosts/sun/etc/strongswan.conf +++ b/testing/tests/route-based/net2net-xfrmi-ike/hosts/sun/etc/strongswan.conf @@ -7,6 +7,6 @@ swanctl { charon-systemd { load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac vici kernel-netlink socket-default start-scripts { - updown = /usr/bin/python /etc/updown.py + updown = /usr/bin/python3 /etc/updown.py } } diff --git a/testing/tests/route-based/net2net-xfrmi-ike/hosts/sun/etc/updown.py b/testing/tests/route-based/net2net-xfrmi-ike/hosts/sun/etc/updown.py index fbe89fcfca..ee593deca7 100755 --- a/testing/tests/route-based/net2net-xfrmi-ike/hosts/sun/etc/updown.py +++ b/testing/tests/route-based/net2net-xfrmi-ike/hosts/sun/etc/updown.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import vici