Skip to content

Commit 1b61b57

Browse files
This PR is to add comments to Test_lookUpUsedCapacity in pkg\ddc\alluxio\utils_test. (#4623)
* Add notation to Test_lookUpUsedCapacity in pkg\ddc\alluxio\utils_test.go. Signed-off-by: falcon <1612759455@qq.com> * Add notation to Test_lookUpUsedCapacity in pkg\ddc\alluxio\utils_test.go Signed-off-by: falcon <1612759455@qq.com> * Add notation to Test_lookUpUsedCapacity in pkg\ddc\alluxio\utils_test.go Signed-off-by: falcon <1612759455@qq.com> --------- Signed-off-by: falcon <1612759455@qq.com>
1 parent 05e4c78 commit 1b61b57

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

pkg/ddc/alluxio/utils_test.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,22 +206,33 @@ func Test_isPortInUsed(t *testing.T) {
206206
}
207207
}
208208

209+
// Test_lookUpUsedCapacity verifies the functionality of lookUpUsedCapacity in retrieving used capacity values based on node identifiers.
210+
// This test validates two key scenarios:
211+
// 1. Capacity lookup using the node's internal IP address (NodeInternalIP type).
212+
// 2. Capacity lookup using the node's internal DNS hostname (NodeInternalDNS type).
213+
// For each case, it checks if the returned value matches the expected capacity from the provided map.
214+
//
215+
// Parameters:
216+
// - t (testing.T): The test object to run the test case.
217+
//
218+
// Returns:
219+
// - None.
209220
func Test_lookUpUsedCapacity(t *testing.T) {
210221
type args struct {
211222
node corev1.Node
212223
usedCapacityMap map[string]int64
213224
}
214-
225+
215226
internalIP := "192.168.1.147"
216227
var usageForInternalIP int64 = 1024
217-
228+
218229
internalHost := "slave001"
219230
var usageForInternalHost int64 = 4096
220-
231+
221232
usedCapacityMap := map[string]int64{}
222233
usedCapacityMap[internalIP] = usageForInternalIP
223234
usedCapacityMap[internalHost] = usageForInternalHost
224-
235+
225236
tests := []struct {
226237
name string
227238
args args

0 commit comments

Comments
 (0)