Example #1
0
    def startNetTest(self,
                     net_test_loader,
                     report_filename,
                     collector_address=None):
        """
        Create the Report for the NetTest and start the report NetTest.

        Args:
            net_test_loader:
                an instance of :class:ooni.nettest.NetTestLoader
        """
        if self.allTestsDone.called:
            self.allTestsDone = defer.Deferred()

        if config.privacy.includepcap:
            self.startSniffing(net_test_loader.testDetails)

        report = Report(net_test_loader.testDetails, report_filename,
                        self.reportEntryManager, collector_address)

        net_test = NetTest(net_test_loader, report)
        net_test.director = self

        yield net_test.report.open()

        yield net_test.initializeInputProcessor()
        try:
            self.activeNetTests.append(net_test)
            self.measurementManager.schedule(net_test.generateMeasurements())

            yield net_test.done
            yield report.close()
        finally:
            self.netTestDone(net_test)
Example #2
0
    def startNetTest(self, net_test_loader, report_filename,
                     collector_address=None):
        """
        Create the Report for the NetTest and start the report NetTest.

        Args:
            net_test_loader:
                an instance of :class:ooni.nettest.NetTestLoader
        """
        if self.allTestsDone.called:
            self.allTestsDone = defer.Deferred()

        if config.privacy.includepcap:
            self.startSniffing(net_test_loader.testDetails)

        report = Report(net_test_loader.testDetails, report_filename,
                        self.reportEntryManager, collector_address)

        net_test = NetTest(net_test_loader, report)
        net_test.director = self

        yield net_test.report.open()

        yield net_test.initializeInputProcessor()
        try:
            self.activeNetTests.append(net_test)
            self.measurementManager.schedule(net_test.generateMeasurements())

            yield net_test.done
            yield report.close()
        finally:
            self.netTestDone(net_test)
Example #3
0
    def startNetTest(self, net_test_loader, reporters):
        """
        Create the Report for the NetTest and start the report NetTest.

        Args:
            net_test_loader:
                an instance of :class:ooni.nettest.NetTestLoader
        """

        if config.privacy.includepcap:
            if not config.reports.pcap:
                config.reports.pcap = config.generatePcapFilename(net_test_loader.testDetails)
            self.startSniffing()

        report = Report(reporters, self.reportEntryManager)

        net_test = NetTest(net_test_loader, report)
        net_test.director = self

        yield net_test.report.open()

        yield net_test.initializeInputProcessor()
        self.measurementManager.schedule(net_test.generateMeasurements())

        self.activeNetTests.append(net_test)

        yield net_test.done
        yield report.close()

        self.netTestDone(net_test)
Example #4
0
    def startNetTest(self, net_test_loader, report_filename,
                     collector_client=None, no_yamloo=False):
        """
        Create the Report for the NetTest and start the report NetTest.

        Args:
            net_test_loader:
                an instance of :class:ooni.nettest.NetTestLoader
        """
        test_details = net_test_loader.getTestDetails()
        test_cases = net_test_loader.getTestCases()

        if self.allTestsDone.called:
            self.allTestsDone = defer.Deferred()

        if config.privacy.includepcap or config.global_options.get('pcapfile', None):
            self.startSniffing(test_details)
        report = Report(test_details, report_filename,
                        self.reportEntryManager,
                        collector_client,
                        no_yamloo)

        yield report.open()
        net_test = NetTest(test_cases, test_details, report)
        net_test.director = self

        yield net_test.initialize()
        try:
            self.activeNetTests.append(net_test)
            self.measurementManager.schedule(net_test.generateMeasurements())

            yield net_test.done
            yield report.close()
        finally:
            self.netTestDone(net_test)
Example #5
0
    def start_net_test_loader(self,
                              net_test_loader,
                              report_filename,
                              collector_client=None,
                              no_yamloo=False,
                              test_details=None,
                              measurement_id=None):
        """
        Create the Report for the NetTest and start the report NetTest.

        Args:
            net_test_loader:
                an instance of :class:ooni.nettest.NetTestLoader
        """
        if test_details is None:
            test_details = net_test_loader.getTestDetails()
        test_cases = net_test_loader.getTestCases()

        if self.allTestsDone.called:
            self.allTestsDone = defer.Deferred()

        if config.privacy.includepcap or config.global_options.get(
                'pcapfile', None):
            self.start_sniffing(test_details)
        report = Report(test_details, report_filename, self.reportEntryManager,
                        collector_client, no_yamloo, measurement_id)

        yield report.open()
        net_test = NetTest(test_cases, test_details, report)
        net_test.director = self

        yield net_test.initialize()
        try:
            self.activeNetTests.append(net_test)
            if measurement_id:
                self.activeMeasurements[measurement_id] = net_test
            self.measurementManager.schedule(net_test.generateMeasurements())

            yield net_test.done
            yield report.close()
        finally:
            if measurement_id:
                del self.activeMeasurements[measurement_id]
            self.netTestDone(net_test)
Example #6
0
    def startNetTest(self,
                     net_test_loader,
                     report_filename,
                     collector_address=None,
                     no_yamloo=False):
        """
        Create the Report for the NetTest and start the report NetTest.

        Args:
            net_test_loader:
                an instance of :class:ooni.nettest.NetTestLoader
        """
        # Here we set the test details again since the geoip lookups may
        # not have already been done and probe_asn and probe_ip
        # are not set.
        net_test_loader.setTestDetails()

        if self.allTestsDone.called:
            self.allTestsDone = defer.Deferred()

        if config.privacy.includepcap:
            self.startSniffing(net_test_loader.testDetails)
        report = Report(net_test_loader.testDetails, report_filename,
                        self.reportEntryManager, collector_address, no_yamloo)

        net_test = NetTest(net_test_loader, report)
        net_test.director = self

        yield net_test.report.open()

        yield net_test.initializeInputProcessor()
        try:
            self.activeNetTests.append(net_test)
            self.measurementManager.schedule(net_test.generateMeasurements())

            yield net_test.done
            yield report.close()
        finally:
            self.netTestDone(net_test)
Example #7
0
    def startNetTest(self, net_test_loader, reporters):
        """
        Create the Report for the NetTest and start the report NetTest.

        Args:
            net_test_loader:
                an instance of :class:ooni.nettest.NetTestLoader
        """
        report = Report(reporters, self.reportEntryManager)

        net_test = NetTest(net_test_loader, report)
        net_test.director = self

        yield net_test.report.open()

        self.measurementManager.schedule(net_test.generateMeasurements())

        self.activeNetTests.append(net_test)

        yield net_test.done
        yield report.close()

        self.netTestDone(net_test)
Example #8
0
    def startNetTest(self, net_test_loader, report_filename,
                     collector_address=None, no_yamloo=False):
        """
        Create the Report for the NetTest and start the report NetTest.

        Args:
            net_test_loader:
                an instance of :class:ooni.nettest.NetTestLoader
        """
        # Here we set the test details again since the geoip lookups may
        # not have already been done and probe_asn and probe_ip
        # are not set.
        net_test_loader.setTestDetails()

        if self.allTestsDone.called:
            self.allTestsDone = defer.Deferred()

        if config.privacy.includepcap:
            self.startSniffing(net_test_loader.testDetails)
        report = Report(net_test_loader.testDetails, report_filename,
                        self.reportEntryManager, collector_address,
                        no_yamloo)

        net_test = NetTest(net_test_loader, report)
        net_test.director = self

        yield net_test.report.open()

        yield net_test.initializeInputProcessor()
        try:
            self.activeNetTests.append(net_test)
            self.measurementManager.schedule(net_test.generateMeasurements())

            yield net_test.done
            yield report.close()
        finally:
            self.netTestDone(net_test)