Esempio n. 1
0
 def test_remove_remote_debian(self):
     self.mock_remotesshclient.is_debian.return_value = True
     self.mock_remotesshclient.is_fedora.return_value = False
     response = {'exit_code': 0, 'foo': 'bar'}
     self.mock_remotesshclient.execute.return_value = response
     result = ohai_solo.remove_remote(self.mock_remotesshclient)
     self.assertEqual(result, response)
     self.mock_remotesshclient.execute.assert_called_once_with(
         'dpkg --purge ohai-solo', cwd='/tmp', escalate=True)
Esempio n. 2
0
 def test_remove_remote_debian(self):
     self.mock_remotesshclient.is_debian.return_value = True
     self.mock_remotesshclient.is_fedora.return_value = False
     response = {'exit_code': 0, 'foo': 'bar'}
     self.mock_remotesshclient.execute.return_value = response
     result = ohai_solo.remove_remote(self.mock_remotesshclient)
     self.assertEqual(result, response)
     self.mock_remotesshclient.execute.assert_called_once_with(
         'dpkg --purge ohai-solo', cwd='/tmp', escalate=True)
Esempio n. 3
0
 def test_remove_remote_debian(self):
     mock_ssh = mock.MagicMock()
     mock_ssh.is_debian.return_value = True
     mock_ssh.is_fedora.return_value = False
     response = {'exit_code': 0, 'foo': 'bar'}
     mock_ssh.execute.return_value = response
     result = ohai_solo.remove_remote(mock_ssh)
     self.assertEqual(result, response)
     mock_ssh.execute.assert_called_once_with(
         'sudo dpkg --purge ohai-solo', wd='/tmp')
Esempio n. 4
0
 def test_remove_remote_with_install_dir_and_spaces(self):
     self.mock_remotesshclient.is_debian.return_value = True
     self.mock_remotesshclient.is_fedora.return_value = False
     response = {'exit_code': 0, 'foo': 'bar'}
     self.mock_remotesshclient.execute.return_value = response
     result = ohai_solo.remove_remote(self.mock_remotesshclient,
                                      install_dir='/srv/a dir')
     self.assertEqual(result, response)
     self.mock_remotesshclient.execute.assert_called_once_with(
         'rm -rf \'/srv/a dir/ohai-solo/\'', cwd='/tmp', escalate=True)
Esempio n. 5
0
 def test_remove_remote_with_install_dir_and_spaces(self):
     self.mock_remotesshclient.is_debian.return_value = True
     self.mock_remotesshclient.is_fedora.return_value = False
     response = {'exit_code': 0, 'foo': 'bar'}
     self.mock_remotesshclient.execute.return_value = response
     result = ohai_solo.remove_remote(self.mock_remotesshclient,
                                      install_dir='/srv/a dir')
     self.assertEqual(result, response)
     self.mock_remotesshclient.execute.assert_called_once_with(
         'rm -rf \'/srv/a dir/ohai-solo/\'', cwd='/tmp', escalate=True)
Esempio n. 6
0
 def test_remove_remote_debian(self):
     mock_ssh = mock.MagicMock()
     mock_ssh.is_debian.return_value = True
     mock_ssh.is_fedora.return_value = False
     response = {'exit_code': 0, 'foo': 'bar'}
     mock_ssh.execute.return_value = response
     result = ohai_solo.remove_remote(mock_ssh)
     self.assertEqual(result, response)
     mock_ssh.execute.assert_called_once_with('sudo dpkg --purge ohai-solo',
                                              wd='/tmp')
Esempio n. 7
0
 def test_remove_remote_debian(self):
     mock_ssh = mock.MagicMock()
     mock_ssh.platform_info = {
         'dist': 'ubuntu',
         'version': "4",
         'arch': 'xyz'
     }
     response = {'exit_code': 0, 'foo': 'bar'}
     mock_ssh.execute.return_value = response
     result = ohai_solo.remove_remote(mock_ssh)
     self.assertEqual(result, response)
     mock_ssh.execute.assert_called_once_with(
         'sudo dpkg --purge ohai-solo', wd='/tmp')