mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 22:13:52 +01:00
netdev.tests: Add fixes for environment variables
+ minor include fix
This commit is contained in:
parent
f384bc1cc9
commit
37678505a9
@ -9,12 +9,11 @@ endif
|
||||
include ../Makefile.tests_common
|
||||
|
||||
USEMODULE += defaulttransceiver
|
||||
USEMODULE += net_help
|
||||
USEMODULE += netdev_base
|
||||
|
||||
DISABLE_MODULE += auto_init
|
||||
|
||||
INCLUDES += -I$(RIOTBASE)/sys/net/include
|
||||
|
||||
CHANNEL ?= 1
|
||||
SENDER_ADDRESS ?= 1
|
||||
RECEIVER_ADDRESS ?= 2
|
||||
|
||||
@ -17,11 +17,22 @@ board = os.environ.get('BOARD', 'native')
|
||||
DEFAULT_TIMEOUT=5
|
||||
|
||||
def main():
|
||||
receiver = spawn("make term", timeout=5, env={"SENDER": '0'})
|
||||
time.sleep(1)
|
||||
sender = spawn("make term", timeout=5, env={"SENDER": '1'})
|
||||
receiver = None
|
||||
sender = None
|
||||
|
||||
if "PORT" in os.environ:
|
||||
del os.environ["PORT"]
|
||||
|
||||
if "TERMFLAGS" in os.environ:
|
||||
del os.environ["TERMFLAGS"]
|
||||
|
||||
try:
|
||||
os.environ["SENDER"] = "0"
|
||||
receiver = spawn("make term", timeout=5)
|
||||
time.sleep(1)
|
||||
os.environ["SENDER"] = "1"
|
||||
sender = spawn("make term", timeout=5)
|
||||
|
||||
receiver.expect(r"RIOT netdev test")
|
||||
sender.expect(r"RIOT netdev test")
|
||||
|
||||
@ -122,9 +133,9 @@ def main():
|
||||
except Abort:
|
||||
return 0
|
||||
finally:
|
||||
if not sender.terminate():
|
||||
if sender and not sender.terminate():
|
||||
sender.terminate(force=True)
|
||||
if not receiver.terminate():
|
||||
if receiver and not receiver.terminate():
|
||||
receiver.terminate(force=True)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user