hostap/tests/hwsim/hwsim_utils.py
Jouni Malinen a311c61dd6 tests: Add test execution mechanism
run-p2p-tests.py can now be used to run all P2P test cases. The
actual test cases are defined in test_p2p_*.py files.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-03-02 12:55:07 +02:00

27 lines
715 B
Python

#!/usr/bin/python
#
# hwsim testing utilities
# Copyright (c) 2013, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import subprocess
import logging
logger = logging.getLogger(__name__)
def test_connectivity(ifname1, ifname2):
cmd = ["sudo",
"../../mac80211_hwsim/tools/hwsim_test",
ifname1,
ifname2]
try:
s = subprocess.check_output(cmd)
logger.debug(s)
except subprocess.CalledProcessError, e:
print "hwsim failed: " + str(e.returncode)
print e.output
raise
def test_connectivity_p2p(dev1, dev2):
test_connectivity(dev1.ifname, dev2.ifname)