svn commit: r346620 - head/tests/sys/opencrypto
Author: ngie Date: Wed Apr 24 04:40:24 2019 New Revision: 346620 URL: https://svnweb.freebsd.org/changeset/base/346620 Log: Reapply whitespace style changes from r346443 after recent changes to tests/sys/opencrypto From r346443: """ Replace hard tabs with four-character indentations, per PEP8. This is being done to separate stylistic changes from the tests from functional ones, as I accidentally introduced a bug to the tests when I used four-space indentation locally. No functional change. """ MFC after:2 months Discussed with: jhb Modified: head/tests/sys/opencrypto/cryptodev.py head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptodev.py == --- head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 02:51:58 2019 (r346619) +++ head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 04:40:24 2019 (r346620) @@ -35,73 +35,79 @@ import array import dpkt from fcntl import ioctl import os +import random import signal from struct import pack as _pack +import time from cryptodevh import * __all__ = [ 'Crypto', 'MismatchError', ] class FindOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('crid', 'i', 0), - ('name', '32s', 0), - ) +__byte_order__ = '@' +__hdr__ = ( +('crid', 'i', 0), +('name', '32s', 0), +) class SessionOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('cipher', 'I', 0), - ('mac', 'I', 0), - ('keylen', 'I', 0), - ('key', 'P', 0), - ('mackeylen', 'i', 0), - ('mackey', 'P', 0), - ('ses', 'I', 0), - ) +__byte_order__ = '@' +__hdr__ = ( +('cipher','I', 0), +('mac', 'I', 0), +('keylen','I', 0), +('key', 'P', 0), +('mackeylen', 'i', 0), +('mackey','P', 0), +('ses', 'I', 0), +) class SessionOp2(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('cipher', 'I', 0), - ('mac', 'I', 0), - ('keylen', 'I', 0), - ('key', 'P', 0), - ('mackeylen', 'i', 0), - ('mackey', 'P', 0), - ('ses', 'I', 0), - ('crid', 'i', 0), - ('pad0', 'i', 0), - ('pad1', 'i', 0), - ('pad2', 'i', 0), - ('pad3', 'i', 0), - ) +__byte_order__ = '@' +__hdr__ = ( +('cipher','I', 0), +('mac', 'I', 0), +('keylen','I', 0), +('key', 'P', 0), +('mackeylen', 'i', 0), +('mackey','P', 0), +('ses', 'I', 0), +('crid', 'i', 0), +('pad0', 'i', 0), +('pad1', 'i', 0), +('pad2', 'i', 0), +('pad3', 'i', 0), +) class CryptOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('ses', 'I', 0), - ('op', 'H', 0), - ('flags', 'H', 0), - ('len', 'I', 0), - ('src', 'P', 0), - ('dst', 'P', 0), - ('mac', 'P', 0), - ('iv', 'P', 0), - ) +__byte_order__ = '@' +__hdr__ = ( +('ses', 'I', 0), +('op','H', 0), +('flags', 'H', 0), +('len', 'I', 0), +('src', 'P', 0), +('dst', 'P', 0), +('mac', 'P', 0), +('iv','P', 0), +) class CryptAEAD(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('ses', 'I', 0), - ('op', 'H', 0), - ('flags', 'H', 0), - ('len', 'I', 0), - ('aadlen', 'I', 0), - ('ivlen', 'I', 0), - ('src', 'P', 0), - ('dst', 'P', 0), - ('aad', 'P', 0), - ('tag', 'P', 0), - ('iv', 'P', 0), - ) +__byte_order__ = '@' +__hdr__ = ( +('ses','I', 0), +('op', 'H', 0), +('flags', 'H', 0), +('len','I', 0), +('aadlen', 'I', 0), +('ivlen', 'I', 0), +('src','P', 0), +('dst','P', 0), +('aad','P', 0), +('tag','P', 0), +('iv', 'P', 0), +) # h2py.py can't handle multiarg macros CRIOGET = 3221513060 @@ -116,549 +122,546 @@ CIOCFINDDEV = 3223610220 CIOCCRYPTAEAD = 3225445229 def _getdev(): - fd = os.open('/dev/crypto', os.O_RDWR) - buf = array.array('I', [0]) - ioctl(fd, CRIOGET, buf, 1) - os.close(fd) +fd = os.open('/dev/crypto', os.O_RDWR) +buf = array.array('I', [0]) +ioctl(fd, CRIOGET, buf, 1) +os.close(fd) - return buf[0] +return buf[0] _cryptode
svn commit: r346620 - head/tests/sys/opencrypto
Author: ngie Date: Wed Apr 24 04:40:24 2019 New Revision: 346620 URL: https://svnweb.freebsd.org/changeset/base/346620 Log: Reapply whitespace style changes from r346443 after recent changes to tests/sys/opencrypto From r346443: """ Replace hard tabs with four-character indentations, per PEP8. This is being done to separate stylistic changes from the tests from functional ones, as I accidentally introduced a bug to the tests when I used four-space indentation locally. No functional change. """ MFC after:2 months Discussed with: jhb Modified: head/tests/sys/opencrypto/cryptodev.py head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptodev.py == --- head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 02:51:58 2019 (r346619) +++ head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 04:40:24 2019 (r346620) @@ -35,73 +35,79 @@ import array import dpkt from fcntl import ioctl import os +import random import signal from struct import pack as _pack +import time from cryptodevh import * __all__ = [ 'Crypto', 'MismatchError', ] class FindOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('crid', 'i', 0), - ('name', '32s', 0), - ) +__byte_order__ = '@' +__hdr__ = ( +('crid', 'i', 0), +('name', '32s', 0), +) class SessionOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('cipher', 'I', 0), - ('mac', 'I', 0), - ('keylen', 'I', 0), - ('key', 'P', 0), - ('mackeylen', 'i', 0), - ('mackey', 'P', 0), - ('ses', 'I', 0), - ) +__byte_order__ = '@' +__hdr__ = ( +('cipher','I', 0), +('mac', 'I', 0), +('keylen','I', 0), +('key', 'P', 0), +('mackeylen', 'i', 0), +('mackey','P', 0), +('ses', 'I', 0), +) class SessionOp2(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('cipher', 'I', 0), - ('mac', 'I', 0), - ('keylen', 'I', 0), - ('key', 'P', 0), - ('mackeylen', 'i', 0), - ('mackey', 'P', 0), - ('ses', 'I', 0), - ('crid', 'i', 0), - ('pad0', 'i', 0), - ('pad1', 'i', 0), - ('pad2', 'i', 0), - ('pad3', 'i', 0), - ) +__byte_order__ = '@' +__hdr__ = ( +('cipher','I', 0), +('mac', 'I', 0), +('keylen','I', 0), +('key', 'P', 0), +('mackeylen', 'i', 0), +('mackey','P', 0), +('ses', 'I', 0), +('crid', 'i', 0), +('pad0', 'i', 0), +('pad1', 'i', 0), +('pad2', 'i', 0), +('pad3', 'i', 0), +) class CryptOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('ses', 'I', 0), - ('op', 'H', 0), - ('flags', 'H', 0), - ('len', 'I', 0), - ('src', 'P', 0), - ('dst', 'P', 0), - ('mac', 'P', 0), - ('iv', 'P', 0), - ) +__byte_order__ = '@' +__hdr__ = ( +('ses', 'I', 0), +('op','H', 0), +('flags', 'H', 0), +('len', 'I', 0), +('src', 'P', 0), +('dst', 'P', 0), +('mac', 'P', 0), +('iv','P', 0), +) class CryptAEAD(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('ses', 'I', 0), - ('op', 'H', 0), - ('flags', 'H', 0), - ('len', 'I', 0), - ('aadlen', 'I', 0), - ('ivlen', 'I', 0), - ('src', 'P', 0), - ('dst', 'P', 0), - ('aad', 'P', 0), - ('tag', 'P', 0), - ('iv', 'P', 0), - ) +__byte_order__ = '@' +__hdr__ = ( +('ses','I', 0), +('op', 'H', 0), +('flags', 'H', 0), +('len','I', 0), +('aadlen', 'I', 0), +('ivlen', 'I', 0), +('src','P', 0), +('dst','P', 0), +('aad','P', 0), +('tag','P', 0), +('iv', 'P', 0), +) # h2py.py can't handle multiarg macros CRIOGET = 3221513060 @@ -116,549 +122,546 @@ CIOCFINDDEV = 3223610220 CIOCCRYPTAEAD = 3225445229 def _getdev(): - fd = os.open('/dev/crypto', os.O_RDWR) - buf = array.array('I', [0]) - ioctl(fd, CRIOGET, buf, 1) - os.close(fd) +fd = os.open('/dev/crypto', os.O_RDWR) +buf = array.array('I', [0]) +ioctl(fd, CRIOGET, buf, 1) +os.close(fd) - return buf[0] +return buf[0] _cryptode