def test_debug_no_write(self):
     cfg = {
         'abc': '123',
         'debug': {
             'verbose': False,
             # Does not actually write here due to mocking...
             'output': '/var/log/cloud-init-debug.log',
         },
     }
     cc = self._get_cloud('ubuntu')
     cc_debug.handle('cc_debug', cfg, cc, LOG, [])
     self.assertRaises(IOError, util.load_file,
                       '/var/log/cloud-init-debug.log')
Пример #2
0
 def test_debug_no_write(self):
     cfg = {
         'abc': '123',
         'debug': {
             'verbose': False,
             # Does not actually write here due to mocking...
             'output': '/var/log/cloud-init-debug.log',
         },
     }
     cc = self._get_cloud('ubuntu')
     cc_debug.handle('cc_debug', cfg, cc, LOG, [])
     self.assertRaises(IOError,
                       util.load_file, '/var/log/cloud-init-debug.log')
 def test_debug_no_write(self, m_locale):
     m_locale.return_value = "en_US.UTF-8"
     cfg = {
         "abc": "123",
         "debug": {
             "verbose": False,
             # Does not actually write here due to mocking...
             "output": "/var/log/cloud-init-debug.log",
         },
     }
     cc = get_cloud()
     cc_debug.handle("cc_debug", cfg, cc, LOG, [])
     self.assertRaises(IOError, util.load_file,
                       "/var/log/cloud-init-debug.log")
Пример #4
0
 def test_debug_no_write(self, m_locale):
     m_locale.return_value = 'en_US.UTF-8'
     cfg = {
         'abc': '123',
         'debug': {
             'verbose': False,
             # Does not actually write here due to mocking...
             'output': '/var/log/cloud-init-debug.log',
         },
     }
     cc = get_cloud()
     cc_debug.handle('cc_debug', cfg, cc, LOG, [])
     self.assertRaises(IOError, util.load_file,
                       '/var/log/cloud-init-debug.log')
 def test_debug_write(self):
     cfg = {
         'abc': '123',
         'c': u'\u20a0',
         'debug': {
             'verbose': True,
             # Does not actually write here due to mocking...
             'output': '/var/log/cloud-init-debug.log',
         },
     }
     cc = self._get_cloud('ubuntu')
     cc_debug.handle('cc_debug', cfg, cc, LOG, [])
     contents = util.load_file('/var/log/cloud-init-debug.log')
     # Some basic sanity tests...
     self.assertNotEqual(0, len(contents))
     for k in cfg.keys():
         self.assertIn(k, contents)
Пример #6
0
 def test_debug_write(self):
     cfg = {
         'abc': '123',
         'c': u'\u20a0',
         'debug': {
             'verbose': True,
             # Does not actually write here due to mocking...
             'output': '/var/log/cloud-init-debug.log',
         },
     }
     cc = self._get_cloud('ubuntu')
     cc_debug.handle('cc_debug', cfg, cc, LOG, [])
     contents = util.load_file('/var/log/cloud-init-debug.log')
     # Some basic sanity tests...
     self.assertNotEqual(0, len(contents))
     for k in cfg.keys():
         self.assertIn(k, contents)
 def test_debug_write(self, m_locale):
     m_locale.return_value = "en_US.UTF-8"
     cfg = {
         "abc": "123",
         "c": "\u20a0",
         "debug": {
             "verbose": True,
             # Does not actually write here due to mocking...
             "output": "/var/log/cloud-init-debug.log",
         },
     }
     cc = get_cloud()
     cc_debug.handle("cc_debug", cfg, cc, LOG, [])
     contents = util.load_file("/var/log/cloud-init-debug.log")
     # Some basic sanity tests...
     self.assertNotEqual(0, len(contents))
     for k in cfg.keys():
         self.assertIn(k, contents)
Пример #8
0
 def test_debug_write(self, m_locale):
     m_locale.return_value = 'en_US.UTF-8'
     cfg = {
         'abc': '123',
         'c': '\u20a0',
         'debug': {
             'verbose': True,
             # Does not actually write here due to mocking...
             'output': '/var/log/cloud-init-debug.log',
         },
     }
     cc = get_cloud()
     cc_debug.handle('cc_debug', cfg, cc, LOG, [])
     contents = util.load_file('/var/log/cloud-init-debug.log')
     # Some basic sanity tests...
     self.assertNotEqual(0, len(contents))
     for k in cfg.keys():
         self.assertIn(k, contents)