Example #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))
Example #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]))
Example #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))
Example #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]))
Example #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]))
Example #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))
Example #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]))
Example #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))
Example #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]))
Example #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]))
Example #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))
Example #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))