-
Notifications
You must be signed in to change notification settings - Fork 260
change apipa network gw address from .1 to .2 #2933
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2af9005
change gw address to .2
ZetaoZhuang 28711d5
refactor and add UTs
ZetaoZhuang 49e4c3c
fix lint
ZetaoZhuang b470f25
fix loopback adapter default gw address
ZetaoZhuang db64cfa
remote address should always be .1
ZetaoZhuang e869e49
Merge branch 'master' into change_gw_address
ZetaoZhuang f4a3c9b
address comment
ZetaoZhuang 5424d04
adjust comment
ZetaoZhuang 261b16c
Merge branch 'master' into change_gw_address
ZetaoZhuang d4b2c5d
ddress comment
ZetaoZhuang a71947c
fix func comment
ZetaoZhuang b5e2204
fix loopback adapter gw
ZetaoZhuang 5dfdcaa
Merge branch 'master' into change_gw_address
ZetaoZhuang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package hnsclient | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/Azure/azure-container-networking/cns" | ||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func TestAdhocAdjustIPConfig(t *testing.T) { | ||
| tests := []struct { | ||
| name string | ||
| ipConfig cns.IPConfiguration | ||
| expected cns.IPConfiguration | ||
| }{ | ||
| { | ||
| name: "expect no change when gw address is not 169.254.128.1", | ||
| ipConfig: cns.IPConfiguration{GatewayIPAddress: "169.254.128.3"}, | ||
| expected: cns.IPConfiguration{GatewayIPAddress: "169.254.128.3"}, | ||
| }, | ||
| { | ||
| name: "expect default gw address is set when gw address is 169.254.128.1", | ||
| ipConfig: cns.IPConfiguration{GatewayIPAddress: "169.254.128.1"}, | ||
| expected: cns.IPConfiguration{GatewayIPAddress: "169.254.128.2"}, | ||
| }, | ||
| } | ||
|
|
||
| for _, tt := range tests { | ||
| tt := tt | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| updateGwForLocalIPConfiguration(&tt.ipConfig) | ||
| assert.Equal(t, tt.expected.GatewayIPAddress, tt.ipConfig.GatewayIPAddress) | ||
| }) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.