diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2020-12-25 20:16:36 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2020-12-25 20:16:36 +0000 |
commit | a03ca66dfd31fea3bddc2f9f99e558dcef179b59 (patch) | |
tree | 45302c36cf6d4639573f40287d81a310b144c165 | |
parent | 5f9908c5f733b786e39e4505e787c49770bbc896 (diff) |
Switch to scapy with python 3.
-rw-r--r-- | regress/sys/netinet6/nd6/LICENSE | 26 | ||||
-rw-r--r-- | regress/sys/netinet6/nd6/Makefile | 15 | ||||
-rw-r--r-- | regress/sys/netinet6/nd6/nd6_ar.py | 10 | ||||
-rw-r--r-- | regress/sys/netinet6/nd6/nd6_dad.py | 10 | ||||
-rw-r--r-- | regress/sys/netinet6/nd6/nd6_nud.py | 10 | ||||
-rw-r--r-- | regress/sys/netinet6/nd6/nd6_una.py | 4 |
6 files changed, 37 insertions, 38 deletions
diff --git a/regress/sys/netinet6/nd6/LICENSE b/regress/sys/netinet6/nd6/LICENSE index 8132b495a44..866739d7ee3 100644 --- a/regress/sys/netinet6/nd6/LICENSE +++ b/regress/sys/netinet6/nd6/LICENSE @@ -1,13 +1,13 @@ -# Copyright (c) 2012-2017 Alexander Bluhm <bluhm@openbsd.org> -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +Copyright (c) 2012-2020 Alexander Bluhm <bluhm@openbsd.org> + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/regress/sys/netinet6/nd6/Makefile b/regress/sys/netinet6/nd6/Makefile index 6da0b122270..c625c70833f 100644 --- a/regress/sys/netinet6/nd6/Makefile +++ b/regress/sys/netinet6/nd6/Makefile @@ -1,13 +1,12 @@ -# $OpenBSD: Makefile,v 1.10 2020/12/17 00:51:13 bluhm Exp $ +# $OpenBSD: Makefile,v 1.11 2020/12/25 20:16:35 bluhm Exp $ # The following ports must be installed: # -# python-2.7 interpreted object-oriented programming language # scapy powerful interactive packet manipulation in python -.if ! exists(/usr/local/bin/python2.7) || ! exists(/usr/local/bin/scapy) +.if ! exists(/usr/local/bin/scapy) regress: - @echo Install python and the scapy module for additional tests. + @echo Install py3-scapy package to run this regress. @echo SKIPPED .endif @@ -77,15 +76,15 @@ addr.py: Makefile # Set variables so that make runs with and without obj directory. # Only do that if necessary to keep visible output short. .if ${.CURDIR} == ${.OBJDIR} -PYTHON = python2.7 -u ./ +PYTHON = python3 -u ./ .else -PYTHON = PYTHONPATH=${.OBJDIR} python2.7 -u ${.CURDIR}/ +PYTHON = PYTHONPATH=${.OBJDIR} python3 -u ${.CURDIR}/ .endif # Clear neighbor cache and ping all addresses. This ensures that # the ip addresses are configured and all routing table are set up # to allow bidirectional packet flow. -REGRESS_TARGETS = run-ping6 +REGRESS_TARGETS += run-ping6 run-ping6: ${SUDO} ndp -c .for ip in LOCAL_ADDR REMOTE_ADDR @@ -96,7 +95,7 @@ run-ping6: ND6_SCRIPTS !!= cd ${.CURDIR} && ls -1 nd6*.py .for s in ${ND6_SCRIPTS} -REGRESS_TARGETS = run-${s} +REGRESS_TARGETS += run-${s} run-${s}: addr.py ${SUDO} ${PYTHON}${s} .endfor diff --git a/regress/sys/netinet6/nd6/nd6_ar.py b/regress/sys/netinet6/nd6/nd6_ar.py index 37fe440ddf2..5d9a013f443 100644 --- a/regress/sys/netinet6/nd6/nd6_ar.py +++ b/regress/sys/netinet6/nd6/nd6_ar.py @@ -1,8 +1,8 @@ -#!/usr/local/bin/python2.7 +#!/usr/local/bin/python3 # send Address Resolution neighbor solicitation # expect an neighbor advertisement answer and check it -print "send address resolution neighbor solicitation packet" +print("send address resolution neighbor solicitation packet") import os from addr import * @@ -41,10 +41,10 @@ for a in ans: ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Neighbor Advertisement': tgt=a.payload.payload.tgt - print "target=%s" % (tgt) + print("target=%s" % (tgt)) if tgt == REMOTE_ADDR6: exit(0) - print "TARGET!=%s" % (REMOTE_ADDR6) + print("TARGET!=%s" % (REMOTE_ADDR6)) exit(1) -print "NO NEIGHBOR ADVERTISEMENT" +print("NO NEIGHBOR ADVERTISEMENT") exit(2) diff --git a/regress/sys/netinet6/nd6/nd6_dad.py b/regress/sys/netinet6/nd6/nd6_dad.py index d9fe8d1fd33..2ddf46d3027 100644 --- a/regress/sys/netinet6/nd6/nd6_dad.py +++ b/regress/sys/netinet6/nd6/nd6_dad.py @@ -1,8 +1,8 @@ -#!/usr/local/bin/python2.7 +#!/usr/local/bin/python3 # send Duplicate Address Detection neighbor solicitation # expect an neighbor advertisement answer and check it -print "send duplicate address detection neighbor solicitation packet" +print("send duplicate address detection neighbor solicitation packet") import os from addr import * @@ -41,10 +41,10 @@ for a in ans: ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Neighbor Advertisement': tgt=a.payload.payload.tgt - print "target=%s" % (tgt) + print("target=%s" % (tgt)) if tgt == REMOTE_ADDR6: exit(0) - print "TARGET!=%s" % (REMOTE_ADDR6) + print("TARGET!=%s" % (REMOTE_ADDR6)) exit(1) -print "NO NEIGHBOR ADVERTISEMENT" +print("NO NEIGHBOR ADVERTISEMENT") exit(2) diff --git a/regress/sys/netinet6/nd6/nd6_nud.py b/regress/sys/netinet6/nd6/nd6_nud.py index b42d13f15cf..603d1499339 100644 --- a/regress/sys/netinet6/nd6/nd6_nud.py +++ b/regress/sys/netinet6/nd6/nd6_nud.py @@ -1,8 +1,8 @@ -#!/usr/local/bin/python2.7 +#!/usr/local/bin/python3 # send Neighbor Unreachability Detection neighbor solicitation # expect an neighbor advertisement answer and check it -print "send neighbor unreachability detection solicitation packet" +print("send neighbor unreachability detection solicitation packet") import os from addr import * @@ -41,10 +41,10 @@ for a in ans: ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Neighbor Advertisement': tgt=a.payload.payload.tgt - print "target=%s" % (tgt) + print("target=%s" % (tgt)) if tgt == REMOTE_ADDR6: exit(0) - print "TARGET!=%s" % (REMOTE_ADDR6) + print("TARGET!=%s" % (REMOTE_ADDR6)) exit(1) -print "NO NEIGHBOR ADVERTISEMENT" +print("NO NEIGHBOR ADVERTISEMENT") exit(2) diff --git a/regress/sys/netinet6/nd6/nd6_una.py b/regress/sys/netinet6/nd6/nd6_una.py index 93888b6bc74..a33f183e312 100644 --- a/regress/sys/netinet6/nd6/nd6_una.py +++ b/regress/sys/netinet6/nd6/nd6_una.py @@ -1,7 +1,7 @@ -#!/usr/local/bin/python2.7 +#!/usr/local/bin/python3 # send Unsolicited Neighbor Advertisement -print "send unsolicited neighbor advertisement packet" +print("send unsolicited neighbor advertisement packet") import os from addr import * |