summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--pyagl/tests/test_can.py5
2 files changed, 6 insertions, 0 deletions
diff --git a/README.md b/README.md
index e99f9c7..e4d6625 100644
--- a/README.md
+++ b/README.md
@@ -109,6 +109,7 @@ Some specific tests are dependent on additional configuration via the following
* AGL_AVAILABLE_INTERFACES - optional, specify which of ethernet, wifi, and bluetooth interfaces are available. The value is a comma separated list, with a default value of "ethernet,wifi,bluetooth".
* AGL_BTMAP_RECIPIENT - optional, when running Bluetooth MAP tests, this would be used as phone number to write text messages to.
* AGL_BTMAP_TEXT - optional, when running Bluetooth MAP tests, messages will be composed with this text.
+* AGL_CAN_INTERFACE - optional, specify the CAN interface to use for CAN testing, default value is "can0".
* AGL_PBAP_PHONENUM - optional , when running Bluetooth PBAP tests, this phone number will be used to .search().
* AGL_PBAP_VCF - optional, for the Bluetooh PBAP tests query a contact entry out of the phonebook.
* AGL_BT_TEST_ADDR - optional, for the Bluetooth tests pair/connect/disconnect with an actual Bluetooth device(phone)'s address . The address should have the DBus address style as "dev_00_01_02_03_04_05" instead of a regular colon-separated MAC address.
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):