wazuh / wazuh-qa

Wazuh - Quality Assurance
GNU General Public License v2.0
60 stars 30 forks source link

DTT1 - Allocator module. The allocation fails if the sshpass utility is not installed #5295

Closed mhamra closed 1 day ago

mhamra commented 1 week ago
Target version Related issue Related PR/dev branch
4.9.0 4495-dtt1-release

Description

The log of this comment shows that the allocator failed to run. The code that generates the exception is this:

https://github.com/wazuh/wazuh-qa/blob/333a6b7ac09b93dbd9e59b2eca5c5f2a7e69ba32/deployability/modules/allocation/vagrant/provider.py#L295-L310

I've checked, and the host machine didn't have the sshpass utility installed. After installing it, the workflow file worked fine.

The current implementation does not check if the sshpass utility is installed or inform the user of the problem. An exception is raised, but with a log message that does not allow the user to fix the problem.

Requested feature:

The VagrantProvider.__remote_host method should process the subprocess.Popen output to log if sshpass is not installed or sshpass cannot connect, or a verification of the current environment needs to be done before launching the command.

Proposed checks

c-bordon commented 1 week ago

We believe that this problem should be attacked in DTT2, since the ideal is not to perform a dependency fix but to change all these ssh calls that are made and replace them with Python libraries so that in this way, the script It also works on systems like Windows and macOS

rauldpm commented 3 days ago

We can improve the remote calls with Python in DTT2 as an enhancement, but we need to fix this behavior as we need to report the real error in DTT1