def setUpClass(cls):
        super(Test, cls).setUpClass()
        if cls._skip_reason:
            return

        ReceiverBuilder.use_greenlets()

        cls._samples_recd = 0

        c4 = cls._conn_config['four_beam']
        outfilename = 'vadcp_output_%s_%s.txt' % (c4.host, c4.port)
        u4_outfile = file(outfilename, 'w')
        c5 = cls._conn_config['fifth_beam']
        outfilename = 'vadcp_output_%s_%s.txt' % (c5.host, c5.port)
        u5_outfile = file(outfilename, 'w')

        cls._client = VadcpClient(cls._conn_config, u4_outfile, u5_outfile)

        cls._client.set_generic_timeout(cls._timeout)

        log.info("connecting")
        cls._client.set_data_listener(cls._data_listener)
        cls._client.connect()

        log.info("sending break and waiting for prompt")
        cls._client.send_break()
Esempio n. 2
0
    def setUpClass(cls):
        super(Test, cls).setUpClass()
        if cls._skip_reason:
            return

        ReceiverBuilder.use_greenlets()

        cls._samples_recd = 0

        c4 = cls._conn_config['four_beam']
        outfilename = 'vadcp_output_%s_%s.txt' % (c4.host, c4.port)
        u4_outfile = file(outfilename, 'w')
        c5 = cls._conn_config['fifth_beam']
        outfilename = 'vadcp_output_%s_%s.txt' % (c5.host, c5.port)
        u5_outfile = file(outfilename, 'w')

        cls._client = VadcpClient(cls._conn_config, u4_outfile, u5_outfile)

        cls._client.set_generic_timeout(cls._timeout)

        log.info("connecting")
        cls._client.set_data_listener(cls._data_listener)
        cls._client.connect()

        log.info("sending break and waiting for prompt")
        cls._client.send_break()
Esempio n. 3
0
    def setUp(self):
        """
        Calls VadcpTestCase.setUp(self), creates and assigns the
        VadcpDriver instance, and assign the comm_config object.
        """
        ReceiverBuilder.use_greenlets()

        VadcpTestCase.setUp(self)

        def evt_callback(event):
            log.info("CALLBACK: %s" % str(event))

        # needed by DriverTestMixin
        self.driver = VadcpDriver(evt_callback)
        self.comms_config = self._conn_config
    def _connect_ooi_digi(self):
        """
        Establishes the connection to the OOI digi.

        The connection is attempted a number of times.

        NOTE: The connection has sporadically failed, which have been fixed by
        rebooting the unit through the web interface (which is
        http://10.180.80.178/html/reboot.htm for the 4-beam unit).
        """

        host = self._conn_config.ooi_digi_host
        port = self._conn_config.ooi_digi_port

        sock = connect_socket(host, port, timeout=self._generic_timeout)

        if 'localhost' == host:
            outfilename = 'vadcp_ooi_digi_output.txt'
        else:
            outfilename = 'vadcp_output_%s_%s.txt' % (host, port)
        outfile = open(outfilename, 'a')
        log.info("creating OOI Digi _Receiver")
        rt = ReceiverBuilder.build_receiver(sock, ooi_digi=True,
                                            outfile=outfile)
        log.info("starting OOI Digi _Receiver")
        rt.start()

        return (sock, rt, host, port)
Esempio n. 5
0
    def _connect_ooi_digi(self):
        """
        Establishes the connection to the OOI digi.

        The connection is attempted a number of times.

        NOTE: The connection has sporadically failed, which have been fixed by
        rebooting the unit through the web interface (which is
        http://10.180.80.178/html/reboot.htm for the 4-beam unit).
        """

        host = self._conn_config.ooi_digi_host
        port = self._conn_config.ooi_digi_port

        sock = connect_socket(host, port, timeout=self._generic_timeout)

        if 'localhost' == host:
            outfilename = 'vadcp_ooi_digi_output.txt'
        else:
            outfilename = 'vadcp_output_%s_%s.txt' % (host, port)
        outfile = open(outfilename, 'a')
        log.info("creating OOI Digi _Receiver")
        rt = ReceiverBuilder.build_receiver(sock,
                                            ooi_digi=True,
                                            outfile=outfile)
        log.info("starting OOI Digi _Receiver")
        rt.start()

        return (sock, rt, host, port)
    def setUpClass(cls):
        super(Test, cls).setUpClass()
        if cls._skip_reason:
            return

        ReceiverBuilder.use_greenlets()

        cc = cls._conn_config[cls._vadcp_unit]
        outfilename = 'vadcp_output_%s_%s.txt' % (cc.host, cc.port)
        outfile = file(outfilename, 'w')

        cls._client = UnitClient(cc, outfile)

        cls._client.set_generic_timeout(cls._timeout)

        log.info("connecting")
        cls._client.set_data_listener(cls._data_listener)
        cls._client.connect()

        log.info("sending break")
        cls._client.send_break()

        log.info("waiting from prompt")
        cls._client._get_prompt()
    def setUpClass(cls):
        super(Test, cls).setUpClass()
        if cls._skip_reason:
            return

        ReceiverBuilder.use_greenlets()

        cc = cls._conn_config[cls._vadcp_unit]
        outfilename = "vadcp_output_%s_%s.txt" % (cc.host, cc.port)
        outfile = file(outfilename, "w")

        cls._client = UnitClient(cc, outfile)

        cls._client.set_generic_timeout(cls._timeout)

        log.info("connecting")
        cls._client.set_data_listener(cls._data_listener)
        cls._client.connect()

        log.info("sending break")
        cls._client.send_break()

        log.info("waiting from prompt")
        cls._client._get_prompt()
    def connect(self):
        """
        Establishes the connection and starts the receiving thread.

        @throws socket.error The socket.error that was raised during the
                         last attempt to connect the socket.
        """
        assert self._sock is None

        host = self._conn_config.host
        port = self._conn_config.port

        self._sock = connect_socket(host, port)

        log.info("creating _Receiver")
        self._rt = ReceiverBuilder.build_receiver(self._sock,
                                  ooi_digi=False,
                                  outfile=self._outfile,
                                  data_listener=self._data_listener,
                                  prefix_state=self._prefix_state)
        log.info("starting _Receiver")
        self._rt.start()
Esempio n. 9
0
    def connect(self):
        """
        Establishes the connection and starts the receiving thread.

        @throws socket.error The socket.error that was raised during the
                         last attempt to connect the socket.
        """
        assert self._sock is None

        host = self._conn_config.host
        port = self._conn_config.port

        self._sock = connect_socket(host, port)

        log.info("creating _Receiver")
        self._rt = ReceiverBuilder.build_receiver(
            self._sock,
            ooi_digi=False,
            outfile=self._outfile,
            data_listener=self._data_listener,
            prefix_state=self._prefix_state)
        log.info("starting _Receiver")
        self._rt.start()
Esempio n. 10
0
 def tearDownClass(self):
     ReceiverBuilder.use_default()