Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: workstation license check #277

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tenthirtyam
Copy link
Collaborator

@tenthirtyam tenthirtyam commented Feb 23, 2025

Summary

Refactors workstationLicenseCheck to enhance the handling of VMware Workstation license checks and improve test coverage. The most important changes include adding a new constant for a version that does not require a license, modifying the license check logic, and adding comprehensive unit tests for the updated logic.

Enhancements to license handling:

  • builder/vmware/common/driver.go: Added a new constant workstationNoLicenseVersion for version 17.6.1, which does not require a license for personal use, and provided notes and references for version changes.
  • builder/vmware/common/driver_workstation_unix.go: Updated the workstationCheckLicense function to skip the license check for versions greater than or equal to workstationNoLicenseVersion and added logging for different scenarios.

Improvements to test coverage:

  • builder/vmware/common/driver_workstation_unix_test.go: Added mock functions and a new testable function testableWorkstationCheckLicense to facilitate unit testing. Implemented multiple test cases to cover various scenarios, including version checks and license file detection.

Resolves #242

Refactors `workstationLicenseCheck` to support updates to  licensing models.

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor the Workstation driver license check on Linux
1 participant