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

make processing of mac addresses case insensitive #2510

Merged
merged 2 commits into from
Jul 29, 2021

Conversation

rconde01
Copy link
Contributor

@rconde01 rconde01 commented Jul 5, 2021

Description

Fixes WaitForNetIP when the vm contains a manual mac address which may contain uppercase characters.

Closes: #2509

Type of change

Please mark options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the CONTRIBUTION guidelines of
    this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

@vmwclabot
Copy link
Member

@rconde01, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@rconde01 rconde01 changed the title make equivalent mac addresses evaluate as equal despite the casing of alpha hex characters make processing of mac addresses case insensitive Jul 5, 2021
@embano1
Copy link
Contributor

embano1 commented Jul 6, 2021

Thx @rconde01 ! Would it be ok to ask for a unit/integration test, e.g. by using the simulator package?

@rconde01
Copy link
Contributor Author

rconde01 commented Jul 6, 2021

@embano1 I'll look at adding that

@vmwclabot
Copy link
Member

@rconde01, VMware has approved your signed contributor license agreement.

Copy link
Member

@dougm dougm left a comment

Choose a reason for hiding this comment

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

Thanks @rconde01 , regarding the test against vcsim, you'll need #2511

With that, the test could be as simple as the diff below, or adding a new sequence of customize, power on and wait.ip

modified   govc/test/vm.bats
@@ -7,7 +7,7 @@ load test_helper
 
   id=/DC0/vm/DC0_H0_VM0
 
-  mac=00:50:56:83:3a:5d
+  mac=00:50:56:83:3A:5D
   run govc vm.customize -vm $id -mac $mac -ip 10.0.0.1 -netmask 255.255.0.0 -type Linux
   assert_success

@rconde01
Copy link
Contributor Author

I added a test...let me know if there's anything else i need to do.

Copy link
Member

@dougm dougm 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 @rconde01 !

@dougm dougm merged commit 0aa1de3 into vmware:master Jul 29, 2021
protochron pushed a commit to protochron/govmomi that referenced this pull request Aug 31, 2021
yuyin002 pushed a commit to yuyin002/govmomi that referenced this pull request Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] virtual_machine.go : WaitForNetIP can fail and hang due to mac address casing mismatch
4 participants