Ejemplo n.º 1
0
 def test_execute_valid_plugin(self):
     """Test that execute plugin works properly"""
     p = VogelerPlugin(plugin_dir=os.path.dirname(__file__)+'/fixtures/plugins/')
     results = p.execute_plugin('facter')
     syskey_subset = {'syskey' : node()}
     format_subset = {'format' : 'yaml'}
     self.assertType(results, 'dict')
     self.assertDictContainsSubset(syskey_subset, results)
     self.assertDictContainsSubset(format_subset, results)
Ejemplo n.º 2
0
 def test_execute_valid_plugin(self):
     """Test that execute plugin works properly"""
     p = VogelerPlugin(plugin_dir=os.path.dirname(__file__) +
                       '/fixtures/plugins/')
     results = p.execute_plugin('facter')
     syskey_subset = {'syskey': node()}
     format_subset = {'format': 'yaml'}
     self.assertType(results, 'dict')
     self.assertDictContainsSubset(syskey_subset, results)
     self.assertDictContainsSubset(format_subset, results)
Ejemplo n.º 3
0
 def test_execute_failing_plugin(self):
     """Test that execute does NOT work with a broken plugin"""
     with self.assertRaises(VogelerException):
         p = VogelerPlugin(plugin_dir=os.path.dirname(__file__) +
                           '/fixtures/plugins/')
         p.execute_plugin('broken')
Ejemplo n.º 4
0
 def test_execute_unauth_plugin(self):
     """Test that execute does NOT work with an unauthorized plugin"""
     with self.assertRaises(VogelerException):
         p = VogelerPlugin()
         p.execute_plugin('invalid')
Ejemplo n.º 5
0
 def test_vogeler_plugin_init_with_fixture(self):
     """Test that creating a Plugin object with a path works"""
     p = VogelerPlugin(plugin_dir=os.path.dirname(__file__) +
                       '/fixtures/plugins/')
     self.assertType(p, 'vogeler.vogeler.VogelerPlugin')
     self.assertFileContains('/tmp/vogeler-plugins.cfg', 'facter')
Ejemplo n.º 6
0
 def test_vogeler_plugin_init(self):
     """Test that creating a Plugin object works"""
     p = VogelerPlugin()
     self.assertType(p, 'vogeler.vogeler.VogelerPlugin')
Ejemplo n.º 7
0
 def test_execute_failing_plugin(self):
     """Test that execute does NOT work with a broken plugin"""
     with self.assertRaises(VogelerException):
         p = VogelerPlugin(plugin_dir=os.path.dirname(__file__)+'/fixtures/plugins/')
         p.execute_plugin('broken')
Ejemplo n.º 8
0
 def test_execute_unauth_plugin(self):
     """Test that execute does NOT work with an unauthorized plugin"""
     with self.assertRaises(VogelerException):
         p = VogelerPlugin()
         p.execute_plugin('invalid')