示例#1
0
 def test_perform_install_fedora(self):
     response = {'exit_code': 0, 'stdout': 'installed remote'}
     self.mock_remotesshclient.execute.return_value = response
     result = ohai_solo.perform_install(self.mock_remotesshclient)
     self.assertEqual(result, response)
     self.assertEqual(self.mock_remotesshclient.execute.call_count, 3)
     self.mock_remotesshclient.execute.assert_has_calls([
         mock.call('wget -N http://readonly.configdiscovery.rackspace.com/install.sh', cwd='/tmp',
                   escalate=True, allow_many=False),
         mock.call('bash install.sh', cwd='/tmp', with_exit_code=True,
                   escalate=True, allow_many=False),
         mock.call('rm install.sh', cwd='/tmp', escalate=True,
                   allow_many=False)])
 def test_perform_install_fedora(self):
     response = {'exit_code': 0, 'stdout': 'installed remote'}
     self.mock_remotesshclient.execute.return_value = response
     result = ohai_solo.perform_install(self.mock_remotesshclient)
     self.assertEqual(result, response)
     self.assertEqual(self.mock_remotesshclient.execute.call_count, 3)
     self.mock_remotesshclient.execute.assert_has_calls([
         mock.call('wget -N http://readonly.configdiscovery.rackspace.com/install.sh', cwd='/tmp',
                   escalate=True, allow_many=False),
         mock.call('bash install.sh', cwd='/tmp', with_exit_code=True,
                   escalate=True, allow_many=False),
         mock.call('rm install.sh', cwd='/tmp', escalate=True,
                   allow_many=False)])