Skip to content

Commit

Permalink
Changed windows-agent-deployment command (#6905)
Browse files Browse the repository at this point in the history
* Repair windows agent deployment command

* Added changelog

* Update CHANGELOG.md
  • Loading branch information
JuanGarriuz authored Aug 13, 2024
1 parent 5360fa7 commit 2f01411
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All notable changes to the Wazuh app project will be documented in this file.

### Fixed

- Fixed windows-agent-deployment-command from deploy new agent [#6905](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6905)
- Fixed rendering an active response as disabled when is active [#6901](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6901)

## Wazuh v4.9.0 - OpenSearch Dashboards 2.13.0 - Revision 03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ describe('getLinuxStartCommand', () => {

describe('getWindowsInstallCommand', () => {
it('should return the correct install command', () => {
let expected = `Invoke-WebRequest -Uri ${test.urlPackage} -OutFile \${env.tmp}\\wazuh-agent; msiexec.exe /i \${env.tmp}\\wazuh-agent /q ${test.optionals.serverAddress} ${test.optionals.wazuhPassword} ${test.optionals.agentGroups} ${test.optionals.agentName} `;
let expected = `Invoke-WebRequest -Uri ${test.urlPackage} -OutFile \$env:tmp\\wazuh-agent; msiexec.exe /i \$env:tmp\\wazuh-agent /q ${test.optionals.serverAddress} ${test.optionals.wazuhPassword} ${test.optionals.agentGroups} ${test.optionals.agentName} `;

const withAllOptionals = getWindowsInstallCommand(test);
expect(withAllOptionals).toEqual(expected);

delete test.optionals.wazuhPassword;
delete test.optionals.agentName;

expected = `Invoke-WebRequest -Uri ${test.urlPackage} -OutFile \${env.tmp}\\wazuh-agent; msiexec.exe /i \${env.tmp}\\wazuh-agent /q ${test.optionals.serverAddress} ${test.optionals.agentGroups} `;
expected = `Invoke-WebRequest -Uri ${test.urlPackage} -OutFile \$env:tmp\\wazuh-agent; msiexec.exe /i \$env:tmp\\wazuh-agent /q ${test.optionals.serverAddress} ${test.optionals.agentGroups} `;
const withServerAddresAndAgentGroupsOptions =
getWindowsInstallCommand(test);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const getWindowsInstallCommand = (
props: tOSEntryInstallCommand<tOptionalParameters>,
) => {
const { optionals, urlPackage, name } = props;
return `Invoke-WebRequest -Uri ${urlPackage} -OutFile \${env.tmp}\\wazuh-agent; msiexec.exe /i \${env.tmp}\\wazuh-agent /q ${
return `Invoke-WebRequest -Uri ${urlPackage} -OutFile \$env:tmp\\wazuh-agent; msiexec.exe /i \$env:tmp\\wazuh-agent /q ${
optionals && getAllOptionals(optionals, name)
}`;
};
Expand Down

0 comments on commit 2f01411

Please sign in to comment.