Example #1
0
 def test_coredump_network_enable_bad_retcode(self):
     '''
     Tests error message given for a single ESXi host.
     '''
     self.assertEqual({HOST: {
         'Error': ERROR
     }}, vsphere.coredump_network_enable(HOST, USER, PASSWORD, True))
Example #2
0
 def test_coredump_network_enable_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: {'Error': ERROR}},
                          vsphere.coredump_network_enable(HOST, USER, PASSWORD, True))
Example #3
0
 def test_coredump_network_enable_success(self):
     '''
     Tests successful function return for a single ESXi host.
     '''
     enabled = True
     self.assertEqual({HOST: {'Coredump Enabled': enabled}},
                      vsphere.coredump_network_enable(HOST, USER, PASSWORD, enabled))
Example #4
0
 def test_coredump_network_enable_host_list_bad_retcode(self):
     '''
     Tests error message returned with list of esxi_hosts.
     '''
     host_1 = 'host_1.foo.com'
     self.assertEqual({host_1: {'Error': ERROR}},
                      vsphere.coredump_network_enable(HOST, USER, PASSWORD, True, esxi_hosts=[host_1]))
Example #5
0
 def test_coredump_network_enable_host_list_bad_retcode(self):
     '''
     Tests error message returned with list of esxi_hosts.
     '''
     host_1 = 'host_1.foo.com'
     self.assertEqual({host_1: {'Error': ERROR}},
                      vsphere.coredump_network_enable(HOST, USER, PASSWORD, True, esxi_hosts=[host_1]))
Example #6
0
 def test_coredump_network_enable_success(self):
     '''
     Tests successful function return for a single ESXi host.
     '''
     enabled = True
     self.assertEqual({HOST: {'Coredump Enabled': enabled}},
                      vsphere.coredump_network_enable(HOST, USER, PASSWORD, enabled))
Example #7
0
 def test_coredump_network_enable_host_list_success(self):
     '''
     Tests successful function return when an esxi_host is provided.
     '''
     enabled = True
     host_1 = 'host_1.foo.com'
     self.assertEqual({host_1: {'Coredump Enabled': enabled}},
                      vsphere.coredump_network_enable(HOST, USER, PASSWORD, enabled, esxi_hosts=[host_1]))
Example #8
0
 def test_coredump_network_enable_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: {'Error': ERROR}},
                          vsphere.coredump_network_enable(HOST, USER, PASSWORD, True, esxi_hosts=[host_1]))
Example #9
0
 def test_coredump_network_enable_host_list_success(self):
     '''
     Tests successful function return when an esxi_host is provided.
     '''
     enabled = True
     host_1 = 'host_1.foo.com'
     self.assertEqual({host_1: {'Coredump Enabled': enabled}},
                      vsphere.coredump_network_enable(HOST, USER, PASSWORD, enabled, esxi_hosts=[host_1]))
Example #10
0
 def test_coredump_network_enable_success(self):
     '''
     Tests successful function return for a single ESXi host.
     '''
     with patch('salt.utils.vmware.esxcli', MagicMock(return_value={'retcode': 0, 'stdout': ''})):
         with patch('salt.modules.vsphere._format_coredump_stdout', MagicMock(return_value={})):
             enabled = True
             self.assertEqual({HOST: {'Coredump Enabled': enabled}},
                              vsphere.coredump_network_enable(HOST, USER, PASSWORD, enabled))
Example #11
0
 def test_coredump_network_enable_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': ''})):
         with patch('salt.modules.vsphere._format_coredump_stdout', MagicMock(return_value={})):
             enabled = True
             host_1 = 'host_1.foo.com'
             self.assertEqual({host_1: {'Coredump Enabled': enabled}},
                              vsphere.coredump_network_enable(HOST, USER, PASSWORD, enabled, esxi_hosts=[host_1]))
Example #12
0
 def test_coredump_network_enable_bad_retcode(self):
     '''
     Tests error message given for a single ESXi host.
     '''
     self.assertEqual({HOST: {'Error': ERROR}},
                      vsphere.coredump_network_enable(HOST, USER, PASSWORD, True))