def __init__(self, argv=None): args = self.parseArgs(argv) self.verbosity = args.verbosity self.pattern = args.pattern self.results_dir = args.results_dir if args.results_dir is not None: print 'Setting results dir to {0}'.format(args.results_dir) src.tests.testcase.setOutputDirectory(args.results_dir) src.tests.testcase.setStreamVerbosity(self.verbosity) hw_resource.global_instance(args.hw_conf_file) self.discover() self.run()
def __init__(self): self.logger = None self.sniffer_process = None self.output_path = None self.outfile = None self.channel = None self.fragment_count = 0 global sniffer_py_path try: sniffer_py_path = subprocess.check_output(["which", "sniffer.py"]).strip() except: sniffer_py_path = '/usr/local/bin/sniffer.py' self.device = hwr.global_instance().get_hw_module(self._hwModel)
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from src.config import wpan_constants as wpan import src.node.fifteen_four_dev_board as ffdb from src.node.wpan_node import WpanCredentials from src.tools import wpan_table_parser import src.hw.hw_resource as hwr import src.tests.testcase as testcase from src.tools.wpan_util import verify, verify_within, is_associated, VerifyError from src.utils import process_cleanup import random import unittest hwr.global_instance() WAIT_INTERVAL = 10 # Thread Mode for end-device and sleepy end-device DEVICE_MODE_SLEEPY_END_DEVICE = wpan.THREAD_MODE_FLAG_FULL_NETWORK_DATA | wpan.THREAD_MODE_FLAG_SECURE_DATA_REQUEST DEVICE_MODE_END_DEVICE = wpan.THREAD_MODE_FLAG_FULL_NETWORK_DATA | wpan.THREAD_MODE_FLAG_FULL_THREAD_DEV \ | wpan.THREAD_MODE_FLAG_SECURE_DATA_REQUEST | wpan.THREAD_MODE_FLAG_RX_ON_WHEN_IDLE class TestChildModeChange(testcase.TestCase): poll_interval = 8000 @classmethod def hardwareSelect(cls): cls.parent = ffdb.ThreadDevBoard() cls.child1 = ffdb.ThreadDevBoard()
def tear_down(self): self.stop() hwr.global_instance().free_hw_module(self.device)