Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
bc0bf4ef
Commit
bc0bf4ef
authored
6 years ago
by
Lang Martin
Browse files
Options
Download
Email Patches
Plain Diff
client_test cleanup comments from review
parent
f8d43234
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/client_test.go
+7
-9
client/client_test.go
with
7 additions
and
9 deletions
+7
-9
client/client_test.go
+
7
-
9
View file @
bc0bf4ef
...
...
@@ -1243,19 +1243,20 @@ func TestClient_UpdateNodeFromDevicesAccumulates(t *testing.T) {
}
// TestClient_UpdateNodeFromFingerprintKeepsConfig asserts manually configured
// network interfaces take precedence over fingerprinted ones.
func
TestClient_UpdateNodeFromFingerprintKeepsConfig
(
t
*
testing
.
T
)
{
t
.
Parallel
()
// Client without network configured updates to match fingerprint
client
,
cleanup
:=
TestClient
(
t
,
nil
)
defer
cleanup
()
// capture the platform fingerprinted device name for the next test
dev
:=
client
.
config
.
Node
.
NodeResources
.
Networks
[
0
]
.
Device
client
.
updateNodeFromFingerprint
(
&
fingerprint
.
FingerprintResponse
{
NodeResources
:
&
structs
.
NodeResources
{
Cpu
:
structs
.
NodeCpuResources
{
CpuShares
:
123
},
Networks
:
[]
*
structs
.
NetworkResource
{
{
Device
:
"any-interface"
},
},
Cpu
:
structs
.
NodeCpuResources
{
CpuShares
:
123
},
Networks
:
[]
*
structs
.
NetworkResource
{{
Device
:
"any-interface"
}},
},
Resources
:
&
structs
.
Resources
{
CPU
:
80
,
...
...
@@ -1276,14 +1277,11 @@ func TestClient_UpdateNodeFromFingerprintKeepsConfig(t *testing.T) {
c
.
Node
.
NodeResources
.
Networks
[
0
]
.
Device
=
dev
c
.
Node
.
Resources
.
Networks
=
c
.
Node
.
NodeResources
.
Networks
})
// REVIEW: are both defers going to run? should I just use different names?
defer
cleanup
()
client
.
updateNodeFromFingerprint
(
&
fingerprint
.
FingerprintResponse
{
NodeResources
:
&
structs
.
NodeResources
{
Cpu
:
structs
.
NodeCpuResources
{
CpuShares
:
123
},
Networks
:
[]
*
structs
.
NetworkResource
{
{
Device
:
"any-interface"
},
},
Cpu
:
structs
.
NodeCpuResources
{
CpuShares
:
123
},
Networks
:
[]
*
structs
.
NetworkResource
{{
Device
:
"any-interface"
}},
},
Resources
:
&
structs
.
Resources
{
CPU
:
80
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment