Esempio n. 1
0
 def test_get_syslog_config_success(self):
     '''
     Tests successful function return for a single ESXi host.
     '''
     self.assertEqual({HOST: {
         'success': True
     }}, vsphere.get_syslog_config(HOST, USER, PASSWORD))
Esempio n. 2
0
 def test_get_syslog_config_host_list_success(self):
     '''
     Tests successful function return when an esxi_host is provided.
     '''
     host_1 = 'host_1.foo.com'
     self.assertEqual({host_1: {'success': True}},
                      vsphere.get_syslog_config(HOST, USER, PASSWORD, esxi_hosts=[host_1]))
Esempio n. 3
0
 def test_get_syslog_config_success(self):
     '''
     Tests successful function return for a single ESXi host.
     '''
     with patch('salt.utils.vmware.esxcli', MagicMock(return_value={'retcode': 0, 'stdout': ''})):
         self.assertEqual({HOST: {'success': True}},
                          vsphere.get_syslog_config(HOST, USER, PASSWORD))
Esempio n. 4
0
 def test_get_syslog_config_host_list_bad_retcode(self):
     '''
     Tests error message returned with list of esxi_hosts.
     '''
     host_1 = 'host_1.foo.com'
     self.assertEqual({host_1: {'message': ERROR, 'success': False}},
                      vsphere.get_syslog_config(HOST, USER, PASSWORD, esxi_hosts=[host_1]))
Esempio n. 5
0
 def test_get_syslog_config_host_list_success(self):
     '''
     Tests successful function return when an esxi_host is provided.
     '''
     host_1 = 'host_1.foo.com'
     self.assertEqual({host_1: {'success': True}},
                      vsphere.get_syslog_config(HOST, USER, PASSWORD, esxi_hosts=[host_1]))
Esempio n. 6
0
 def test_get_syslog_config_bad_retcode(self):
     '''
     Tests error message given for a single ESXi host.
     '''
     with patch('salt.utils.vmware.esxcli', MagicMock(return_value={'retcode': 1, 'stdout': ERROR})):
         self.assertEqual({HOST: {'message': ERROR, 'success': False}},
                          vsphere.get_syslog_config(HOST, USER, PASSWORD))
Esempio n. 7
0
 def test_get_syslog_config_host_list_bad_retcode(self):
     '''
     Tests error message returned with list of esxi_hosts.
     '''
     host_1 = 'host_1.foo.com'
     self.assertEqual({host_1: {'message': ERROR, 'success': False}},
                      vsphere.get_syslog_config(HOST, USER, PASSWORD, esxi_hosts=[host_1]))
Esempio n. 8
0
 def test_get_syslog_config_bad_retcode(self):
     '''
     Tests error message given for a single ESXi host.
     '''
     self.assertEqual({HOST: {
         'message': ERROR,
         'success': False
     }}, vsphere.get_syslog_config(HOST, USER, PASSWORD))
Esempio n. 9
0
 def test_get_syslog_config_host_list_success(self):
     '''
     Tests successful function return when an esxi_host is provided.
     '''
     with patch('salt.utils.vmware.esxcli', MagicMock(return_value={'retcode': 0, 'stdout': ''})):
         host_1 = 'host_1.foo.com'
         self.assertEqual({host_1: {'success': True}},
                          vsphere.get_syslog_config(HOST, USER, PASSWORD, esxi_hosts=[host_1]))
Esempio n. 10
0
 def test_get_syslog_config_host_list_bad_retcode(self):
     '''
     Tests error message returned with list of esxi_hosts.
     '''
     with patch('salt.utils.vmware.esxcli', MagicMock(return_value={'retcode': 1, 'stdout': ERROR})):
         host_1 = 'host_1.foo.com'
         self.assertEqual({host_1: {'message': ERROR, 'success': False}},
                          vsphere.get_syslog_config(HOST, USER, PASSWORD, esxi_hosts=[host_1]))
Esempio n. 11
0
 def test_get_syslog_config_success(self):
     '''
     Tests successful function return for a single ESXi host.
     '''
     self.assertEqual({HOST: {'success': True}},
                      vsphere.get_syslog_config(HOST, USER, PASSWORD))
Esempio n. 12
0
 def test_get_syslog_config_bad_retcode(self):
     '''
     Tests error message given for a single ESXi host.
     '''
     self.assertEqual({HOST: {'message': ERROR, 'success': False}},
                      vsphere.get_syslog_config(HOST, USER, PASSWORD))