Ejemplo n.º 1
0
 def test_send_multiple(self):
     data = {'hello': 7, 'goodbye': 11}
     statsd.send(data)
     calls = [
         mock.call(b'hello:7|g', self._address),
         mock.call(b'goodbye:11|g', self._address)
     ]
     self.mock_socket.return_value.sendto.assert_has_calls(calls)
Ejemplo n.º 2
0
 def testLibvirtConfigureShouldEnableSockets(self):
     _setConfig(self,
                ('LCONF', 'lconf_ssl'),
                ('QCONF', 'qemu_ssl'),
                )
     libvirt.configure()
     systemctl.enable.assert_has_calls([
         mock.call(libvirt._LIBVIRT_TCP_SOCKET_UNIT),
         mock.call(libvirt._LIBVIRT_TLS_SOCKET_UNIT)
     ])
Ejemplo n.º 3
0
    def testLibvirtConfigureShouldEnableTlsSocket(self):
        self.vdsm_cfg.set('vars', 'ssl', 'true')
        _setConfig(
            self,
            ('LCONF', 'lconf_ssl'),
            ('QCONF', 'qemu_ssl'),
        )

        libvirt.configure()
        systemctl.enable.assert_has_calls(
            [mock.call(libvirt._LIBVIRT_TLS_SOCKET_UNIT)])
Ejemplo n.º 4
0
 def test_send_multiple(self):
     data = {'hello': 7, 'goodbye': 11}
     statsd.send(data)
     calls = [mock.call(b'hello:7|g', self._address),
              mock.call(b'goodbye:11|g', self._address)]
     self.mock_socket.return_value.sendto.assert_has_calls(calls)