示例#1
0
import getopt
import sys

from happy.Utils import *
import happy.HappyNodeList
import WeaveStateLoad
import WeaveStateUnload
import WeavePing
import WeaveTunnelStart
import WeaveTunnelStop
import WeaveUtilities
from WeaveTest import WeaveTest
import plugins.plaid.Plaid as Plaid


gFaultopts = WeaveUtilities.FaultInjectionOptions(nodes=["gateway", "service"])
gOptions = { 'case': True, "num_pings": "3", "restart": True }

class test_weave_tunnel_faults(unittest.TestCase):
    def setUp(self):
        self.tap = None

        if "WEAVE_SYSTEM_CONFIG_USE_LWIP" in os.environ.keys() and os.environ["WEAVE_SYSTEM_CONFIG_USE_LWIP"] == "1":
            self.topology_file = os.path.dirname(os.path.realpath(__file__)) + \
                "/../../../topologies/standalone/thread_wifi_on_tap_ap_service.json"
            self.tap = "wpan0"
        else:
            self.topology_file = os.path.dirname(os.path.realpath(__file__)) + \
                "/../../../topologies/standalone/thread_wifi_ap_service.json"

        self.show_strace = False
#    @file
#       Injects a series of faults into the SubscriptionClient and
#       SubscriptionHandler, confirming the retry mechanism for a
#       mutual subscription is still successfully established
#       after some number of resubscribes.
#

import getopt
import sys
import unittest
import set_test_path
import WeaveUtilities

from weave_wdm_next_test_base import weave_wdm_next_test_base

gFaultopts = WeaveUtilities.FaultInjectionOptions()


class test_weave_wdm_next_mutual_resub(weave_wdm_next_test_base):
    def test_weave_wdm_next_mutual_resub(self):
        wdm_next_args = {}

        wdm_next_args['wdm_option'] = "mutual_subscribe"

        wdm_next_args['total_client_count'] = 2
        wdm_next_args['final_client_status'] = 0
        wdm_next_args['timer_client_period'] = 5000
        wdm_next_args['enable_client_stop'] = True
        wdm_next_args['test_client_iterations'] = 1
        wdm_next_args['test_client_delay'] = 2000
        wdm_next_args['enable_client_flip'] = 1
import itertools
import os
import unittest
import set_test_path
import getopt
import sys

from happy.Utils import *
import happy.HappyNodeList
import WeaveStateLoad
import WeaveStateUnload
import WeaveServiceDir
import WeaveUtilities

gFaultopts = WeaveUtilities.FaultInjectionOptions(nodes=["client", "service"])
gOptions = {"fault-injection": False}


class test_service_directory_01(unittest.TestCase):
    def setUp(self):
        self.tap = None

        if "WEAVE_SYSTEM_CONFIG_USE_LWIP" in os.environ.keys(
        ) and os.environ["WEAVE_SYSTEM_CONFIG_USE_LWIP"] == "1":
            self.topology_file = os.path.dirname(os.path.realpath(__file__)) + \
                "/../../../topologies/standalone/thread_wifi_on_tap_ap_service.json"
            self.tap = "wpan0"
        else:
            self.topology_file = os.path.dirname(os.path.realpath(__file__)) + \
                "/../../../topologies/standalone/thread_wifi_ap_service.json"