1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-16 21:38:23 +00:00

nfd-master: correct a mistake in unit tests

Annotations were not correctly checked when testing
mockServer.updateNodeFeatures().
This commit is contained in:
Markus Lehtonen 2019-05-08 11:08:14 +03:00
parent 7f43a3db4e
commit 470cf8dff2

View file

@ -56,6 +56,7 @@ func TestUpdateNodeFeatures(t *testing.T) {
for k, _ := range fakeFeatureLabels { for k, _ := range fakeFeatureLabels {
fakeFeatureLabelNames = append(fakeFeatureLabelNames, k) fakeFeatureLabelNames = append(fakeFeatureLabelNames, k)
} }
sort.Strings(fakeFeatureLabelNames)
fakeAnnotations["feature-labels"] = strings.Join(fakeFeatureLabelNames, ",") fakeAnnotations["feature-labels"] = strings.Join(fakeFeatureLabelNames, ",")
mockAPIHelper := new(apihelper.MockAPIHelpers) mockAPIHelper := new(apihelper.MockAPIHelpers)
@ -80,8 +81,8 @@ func TestUpdateNodeFeatures(t *testing.T) {
So(mockNode.Labels[labelNs+k], ShouldEqual, v) So(mockNode.Labels[labelNs+k], ShouldEqual, v)
} }
So(len(mockNode.Annotations), ShouldEqual, len(fakeAnnotations)) So(len(mockNode.Annotations), ShouldEqual, len(fakeAnnotations))
for k, v := range fakeFeatureLabels { for k, v := range fakeAnnotations {
So(mockNode.Labels[labelNs+k], ShouldEqual, v) So(mockNode.Annotations[annotationNs+k], ShouldEqual, v)
} }
}) })
}) })