summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsin-Yi Chen <hsinyichen@google.com>2018-06-25 18:33:21 +0800
committerHsin-Yi Chen <hsinyichen@google.com>2018-06-26 07:48:59 +0000
commite57d074dc520ab1feabe5b202e6ef1c3f9f9844b (patch)
tree1dceafae8bd69e61ce21f669f7f4942bb9b0408e
parent60317ba07e58a16ffe300b963a0b6fcbb8e17c07 (diff)
downloadtests-pie-qpr1-s1-release.tar.gz
- 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-xnet/test/bpf.py1
-rw-r--r--net/test/csocket.py7
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("."))