示例#1
0
    def validate_happy_sequence(self):

        output_logs = self.output_logs
        counters = {}
        counters['client'] = WeaveUtilities.parse_fault_injection_counters(
            output_logs['client'])
        counters['server'] = WeaveUtilities.parse_fault_injection_counters(
            output_logs['server'])

        # As of today, all fault points should be executed on the server
        required_server_faults = [
            key for key in counters["server"].keys() if "Weave_WDM" in key
        ]

        # This will raise a ValueError
        WeaveUtilities.validate_counters(required_server_faults,
                                         counters["server"], "server")

        # As of today, the client does not send commands
        required_client_faults = [
            key for key in counters["client"].keys()
            if "Weave_WDM" in key and not "SendCommand" in key
        ]

        # This will raise a ValueError
        WeaveUtilities.validate_counters(required_client_faults,
                                         counters["client"], "client")
示例#2
0
    def validate_happy_sequence(self):

        output_logs = self.output_logs
        counters = {}
        counters['client'] = WeaveUtilities.parse_fault_injection_counters(
            output_logs['client'])
        counters['server'] = WeaveUtilities.parse_fault_injection_counters(
            output_logs['server'])

        # As of today, all fault points should be executed on the server, but not the WDM Update ones
        wdm_udpate_faults = [
            "Weave_WDMSendUpdateBadVersion", "Weave_WDMDelayUpdateResponse",
            "Weave_WDMUpdateRequestTimeout",
            "Weave_WDMUpdateRequestSendErrorInline",
            "Weave_WDMUpdateRequestSendErrorAsync",
            "Weave_WDMUpdateRequestBadProfile", "Weave_WDMUpdateResponseBusy",
            "Weave_WDMUpdateRequestDropMessage", "Weave_WDMPathStoreFull"
        ]
        not_required_server_faults = wdm_udpate_faults

        required_server_faults = [
            key for key in counters["server"].keys()
            if "Weave_WDM" in key and key not in not_required_server_faults
        ]

        # This will raise a ValueError
        WeaveUtilities.validate_counters(required_server_faults,
                                         counters["server"], "server")

        # As of today, the client does not send commands nor updates
        not_required_client_faults = [
            "Weave_WDMSendCommandBadVersion", "Weave_WDMSendCommandExpired"
        ]
        not_required_client_faults += wdm_udpate_faults

        required_client_faults = [
            key for key in counters["client"].keys()
            if "Weave_WDM" in key and key not in not_required_client_faults
        ]

        # This will raise a ValueError
        WeaveUtilities.validate_counters(required_client_faults,
                                         counters["client"], "client")