aboutsummaryrefslogtreecommitdiffstats
path: root/pyagl
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2021-01-13 11:09:56 -0500
committerScott Murray <scott.murray@konsulko.com>2021-01-13 11:15:51 -0500
commit5a7414cbc1b371f4b83f94eaaf7501765b6bec26 (patch)
treef4d5d4b2aa2be93d89d5512e00bcd302db4fe6e4 /pyagl
parent003ccc0db802f97349451b3f291188d8518e5232 (diff)
Support specifying CAN interface for testskoi_10.93.0koi_10.92.0koi/10.93.0koi/10.92.010.93.010.92.0
Add AGL_CAN_INTERFACE environment variable hook to allow specifying the CAN interface to be used in the CAN tests. This is required when using an interface other than the default of "can0", since the specific interface is needed for playback of CAN data to test binding behavior. The switch in AGL CI to using vcan0 on all test boards will require this hook. Bug-AGL: SPEC-3756 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: If84731ae39fd65f8fa88d24ddc0370da63ca5489
Diffstat (limited to 'pyagl')
-rw-r--r--pyagl/tests/test_can.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pyagl/tests/test_can.py b/pyagl/tests/test_can.py
index 4766f55..6081ee9 100644
--- a/pyagl/tests/test_can.py
+++ b/pyagl/tests/test_can.py
@@ -63,6 +63,7 @@ class canplayer:
def __init__(self, service : cs):
self.service = service
self.remote = service.ip != 'localhost'
+ self.interface = os.environ.get('AGL_CAN_INTERFACE', 'can0')
self.args = [ '/usr/bin/canplayer', '-I' ]
async def play(self, filename : str):
@@ -70,6 +71,8 @@ class canplayer:
filename = '/tmp/' + filename
args = self.args
args.append(filename)
+ if self.interface != "can0":
+ args.append(self.interface + "=can0")
self.ssh = await asyncssh.connect(self.service.ip, username='root', known_hosts=None)
self.task = await self.ssh.create_process(' '.join(args))
else:
@@ -77,6 +80,8 @@ class canplayer:
data = path.joinpath('data', 'can', filename)
args = self.args
args.append(str(data))
+ if self.interface != "can0":
+ args.append(self.interface + "=can0")
self.task = subprocess.Popen(args)
async def stop(self):