Example #1
0
 def test_ceilometer_context(self, secret):
     secret.return_value = 'mysecret'
     self.assertEqual(
         contexts.CeilometerContext()(), {
             'port': 8777,
             'metering_secret': 'mysecret',
             'metering_time_to_live': -1,
             'event_time_to_live': -1,
         })
 def test_ceilometer_context(self, secret):
     secret.return_value = 'mysecret'
     self.assertEqual(
         contexts.CeilometerContext()(), {
             'port': 8777,
             'metering_secret': 'mysecret',
             'metering_time_to_live': -1,
             'event_time_to_live': -1,
             'polling_interval': 300,
             'enable_all_pollsters': False,
         })
 def test_ceilometer_context_enable_all_pollsters(self, secret):
     secret.return_value = 'mysecret'
     self.test_config.set('enable-all-pollsters', True)
     context = contexts.CeilometerContext()()
     self.assertEqual(
         context, {
             'port': 8777,
             'metering_secret': 'mysecret',
             'metering_time_to_live': -1,
             'event_time_to_live': -1,
             'polling_interval': 300,
             'enable_all_pollsters': True,
         })
Example #4
0
 def test_ceilometer_context_ttl_values(self, secret):
     secret.return_value = 'mysecret'
     self.test_config.set('metering-time-to-live', 7.776e+06)
     self.test_config.set('event-time-to-live', 7.776e+06)
     context = contexts.CeilometerContext()()
     self.assertEqual(
         context, {
             'port': 8777,
             'metering_secret': 'mysecret',
             'metering_time_to_live': 7776000,
             'event_time_to_live': 7776000,
         })
     self.assertTrue(type(context['metering_time_to_live']) is int)
     self.assertTrue(type(context['event_time_to_live']) is int)