Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions awscli/customizations/codedeploy/systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ def install(self, params):

subprocess.check_call(
[
r'.\{0}'.format(self.INSTALLER),
'msiexec.exe',
'/i', r'.\{0}'.format(self.INSTALLER),
'/quiet',
'/l', r'.\codedeploy-agent-install-log.txt'
],
shell=True
]
)
subprocess.check_call([
'powershell.exe',
Expand Down
25 changes: 22 additions & 3 deletions tests/unit/customizations/codedeploy/test_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ def test_install(self):
self.check_call.assert_has_calls([
mock.call(
[
r'.\{0}'.format(self.installer),
'msiexec.exe',
'/i', r'.\{0}'.format(self.installer),
'/quiet',
'/l', r'.\codedeploy-agent-install-log.txt'
],
shell=True
]
),
mock.call([
'powershell.exe',
Expand All @@ -120,6 +120,25 @@ def test_install(self):
self.open.assert_called_with(self.installer, 'wb')
self.open().write.assert_called_with(self.body)

def test_install_uses_msiexec_for_custom_installer(self):
process = mock.MagicMock()
process.communicate.side_effect = [('', ''), ('Running', '')]
process.returncode = 0
self.popen.return_value = process
self.params.installer = 'agent&installer.msi'
self.windows.install(self.params)
self.check_call.assert_has_calls([
mock.call(
[
'msiexec.exe',
'/i', r'.\{0}'.format(self.params.installer),
'/quiet',
'/l', r'.\codedeploy-agent-install-log.txt'
]
)
])
self.open.assert_called_with(self.params.installer, 'wb')

def test_uninstall(self):
process = mock.MagicMock()
process.communicate.side_effect = [('', ''), ('', '')]
Expand Down