Skip to content

refactor: workstation license check#277

Merged
lbajolet-hashicorp merged 1 commit intomainfrom
refactor/workstation-license-check
Apr 22, 2025
Merged

refactor: workstation license check#277
lbajolet-hashicorp merged 1 commit intomainfrom
refactor/workstation-license-check

Conversation

@tenthirtyam
Copy link
Copy Markdown
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.2, which no longer requires a license for use - free for personal and commercia 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

@tenthirtyam tenthirtyam added the hypervisor/workstation VMware Workstation label Feb 23, 2025
@tenthirtyam tenthirtyam added this to the v1.1.1 milestone Feb 23, 2025
@tenthirtyam tenthirtyam self-assigned this Feb 23, 2025
@tenthirtyam tenthirtyam requested a review from a team as a code owner February 23, 2025 18:06
@lbajolet-hashicorp lbajolet-hashicorp force-pushed the refactor/workstation-license-check branch from 8652848 to d4f074c Compare March 20, 2025 20:34
Copy link
Copy Markdown
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left a small question on one constant, but the rest of the changes look good to me.

Refactors `workstationLicenseCheck` to support updates to  licensing models.

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
@tenthirtyam tenthirtyam force-pushed the refactor/workstation-license-check branch from f448275 to 4421b25 Compare April 14, 2025 20:50
Copy link
Copy Markdown
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @tenthirtyam!

@lbajolet-hashicorp lbajolet-hashicorp merged commit 0bbf527 into main Apr 22, 2025
14 checks passed
@lbajolet-hashicorp lbajolet-hashicorp deleted the refactor/workstation-license-check branch April 22, 2025 19:18
@github-actions
Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

hypervisor/workstation VMware Workstation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor the Workstation driver license check on Linux

2 participants