Example #1
0
 def _create_glance_rawdata(self):
     deployment = db.get_or_create_deployment('deployment1')[0]
     kwargs = {
         'deployment': deployment,
         'when': dt_to_decimal(datetime.utcnow()),
         'owner': '1234567',
         'json': '{}',
         'routing_key': 'glance_monitor.info',
         'image_type': 1,
         'publisher': 'publisher',
         'event': 'event',
         'service': 'service',
         'host': 'host',
         'instance': '1234-5678-9012-3456',
         'request_id': '1234',
         'uuid': '1234-5678-0912-3456',
         'status': 'active',
     }
     db.create_glance_rawdata(**kwargs)
     rawdata = GlanceRawData.objects.all()[0]
     return kwargs, rawdata
Example #2
0
 def _create_glance_rawdata(self):
     deployment = db.get_or_create_deployment('deployment1')[0]
     kwargs = {
         'deployment': deployment,
         'when': dt_to_decimal(datetime.utcnow()),
         'owner': '1234567',
         'json': '{}',
         'routing_key': 'glance_monitor.info',
         'image_type': 1,
         'publisher': 'publisher',
         'event': 'event',
         'service': 'service',
         'host': 'host',
         'instance': '1234-5678-9012-3456',
         'request_id': '1234',
         'uuid': '1234-5678-0912-3456',
         'status': 'active',
     }
     db.create_glance_rawdata(**kwargs)
     rawdata = GlanceRawData.objects.all()[0]
     return kwargs, rawdata
Example #3
0
        expected_result = [[
            '#', '?', 'When', 'Deployment', 'Event', 'Host', 'Status'
        ],
                           [
                               1L, ' ', '2013-07-17 10:16:10.717219', 'depl',
                               'event', 'host', 'status'
                           ]]
        depl = db.get_or_create_deployment('depl')[0]
        when = dt.dt_to_decimal(datetime.utcnow())

        glance_raw = db.create_glance_rawdata(deployment=depl,
                                              routing_key='routing_key',
                                              json='json',
                                              when=when,
                                              publisher='publisher',
                                              event='event',
                                              service='glance',
                                              host='host',
                                              uuid='instance',
                                              request_id='req-1234',
                                              status='status',
                                              image_type=1)

        results = glance_raw.search_results({}, "2013-07-17 10:16:10.717219",
                                            ' ')
        self.assertEqual(results, expected_result)

    def test_search_results_for_generic(self):
        expected_result = [[
            '#', '?', 'When', 'Deployment', 'Event', 'Host', 'Instance',
            'Request id'
        ],
Example #4
0
        self.assertEqual(results,expected_result)

    def test_search_results_for_glance(self):
        expected_result = [['#', '?', 'When', 'Deployment', 'Event', 'Host',
                            'Status'], [1L, ' ',
                            '2013-07-17 10:16:10.717219', 'depl', 'event',
                            'host', 'status']]
        depl = db.get_or_create_deployment('depl')[0]
        when = dt.dt_to_decimal(datetime.utcnow())

        glance_raw = db.create_glance_rawdata(deployment=depl,
                                              routing_key='routing_key',
                                              json='json',
                                              when=when,
                                              publisher='publisher',
                                              event='event',
                                              service='glance',
                                              host='host',
                                              uuid='instance',
                                              request_id='req-1234',
                                              status='status',
                                              image_type=1)

        results = glance_raw.search_results({}, "2013-07-17 10:16:10.717219",
                                                ' ')
        self.assertEqual(results,expected_result)

    def test_search_results_for_generic(self):
        expected_result = [['#', '?', 'When', 'Deployment', 'Event', 'Host',
                            'Instance', 'Request id'], [1L, ' ',
                            '2013-07-17 10:16:10.717219', 'depl', 'event',
                            'host', 'instance', 'req-1234']]