diff options
author | Hsin-Yi Chen <hsinyichen@google.com> | 2018-06-25 18:33:21 +0800 |
---|---|---|
committer | Hsin-Yi Chen <hsinyichen@google.com> | 2018-06-26 07:48:59 +0000 |
commit | e57d074dc520ab1feabe5b202e6ef1c3f9f9844b (patch) | |
tree | 1dceafae8bd69e61ce21f669f7f4942bb9b0408e | |
parent | 60317ba07e58a16ffe300b963a0b6fcbb8e17c07 (diff) | |
download | tests-pie-qpr1-s1-release.tar.gz |
Fix net tests for 32-bit kernelandroid-9.0.0_r30android-9.0.0_r22android-9.0.0_r21android-9.0.0_r20android-9.0.0_r19android-9.0.0_r16pie-qpr1-s3-releasepie-qpr1-s2-releasepie-qpr1-s1-releasepie-qpr1-releasepie-dr1-dev
- Add bpf syscall number for arm7l.
- Ignore non-numeric suffix of kernel version.
Bug: 110440652
Test: run vts -m VtsKernelNetTest
Change-Id: Idd7f278b7f801296957c2a5b2fd092e8ba34da69
Merged-In: If217c961fdd45b013a7d83967bcab8c746804b97
-rwxr-xr-x | net/test/bpf.py | 1 | ||||
-rw-r--r-- | net/test/csocket.py | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/net/test/bpf.py b/net/test/bpf.py index c9ad264..5e90daa 100755 --- a/net/test/bpf.py +++ b/net/test/bpf.py @@ -26,6 +26,7 @@ import socket # TODO: is there a better way of doing this? __NR_bpf = { "aarch64": 280, + "armv7l": 386, "armv8l": 386, "x86_64": 321}[os.uname()[4]] diff --git a/net/test/csocket.py b/net/test/csocket.py index bdd501c..ccabf4a 100644 --- a/net/test/csocket.py +++ b/net/test/csocket.py @@ -17,6 +17,7 @@ import ctypes import ctypes.util import os +import re import socket import struct @@ -78,9 +79,9 @@ libc = ctypes.CDLL(ctypes.util.find_library("c"), use_errno=True) # TODO: Unlike most of this file, these functions aren't specific to wrapping C # library calls. Move them to a utils.py or constants.py file, once we have one. def LinuxVersion(): - # Example: "3.4.67-00753-gb7a556f". - # Get the part before the dash. - version = os.uname()[2].split("-")[0] + # Example: "3.4.67-00753-gb7a556f", "4.4.135+". + # Get the prefix consisting of digits and dots. + version = re.search("^[0-9.]*", os.uname()[2]).group() # Convert it into a tuple such as (3, 4, 67). That allows comparing versions # using < and >, since tuples are compared lexicographically. version = tuple(int(i) for i in version.split(".")) |