Fix unit tests

This commit is contained in:
Jan Eitzinger
2023-03-22 07:05:41 +01:00
parent 5d526e1168
commit a168efa8c8
5 changed files with 88 additions and 15 deletions

View File

@@ -141,7 +141,7 @@ func TestLoadCluster(t *testing.T) {
t.Fatal(err)
}
if cfg.SubClusters[0].CoresPerSocket != 10 {
if cfg.SubClusters[0].CoresPerSocket != 4 {
t.Fail()
}
}

View File

@@ -45,9 +45,29 @@ func TestValidateCluster(t *testing.T) {
"socketsPerNode": 2,
"coresPerSocket": 10,
"threadsPerCore": 2,
"flopRateScalar": 44,
"flopRateSimd": 704,
"memoryBandwidth": 80,
"flopRateScalar": {
"unit": {
"prefix": "G",
"base": "F/s"
},
"value": 14
},
"flopRateSimd": {
"unit": {
"prefix": "G",
"base": "F/s"
},
"value": 112
},
"memoryBandwidth": {
"unit": {
"prefix": "G",
"base": "B/s"
},
"value": 24
},
"numberOfNodes": 70,
"nodes": "w11[27-45,49-63,69-72]",
"topology": {
"node": [0,20,1,21,2,22,3,23,4,24,5,25,6,26,7,27,8,28,9,29,10,30,11,31,12,32,13,33,14,34,15,35,16,36,17,37,18,38,19,39],
"socket": [
@@ -69,7 +89,12 @@ func TestValidateCluster(t *testing.T) {
"name": "cpu_load",
"scope": "hwthread",
"unit": {"base": "load"},
"timestep": 60
"aggregation": "avg",
"timestep": 60,
"peak": 4,
"normal": 2,
"caution": 1,
"alert": 0.25
}
]
}`)

View File

@@ -251,8 +251,8 @@ func TestNormalizeValueNoPrefix(t *testing.T) {
if v != 104.00 {
t.Errorf("Failed ConvertValue: Want 104.00, Got %f", v)
}
if s != "MFlops/s" {
t.Errorf("Failed Prefix or unit: Want GB/s, Got %s", s)
if s != "MF/s" {
t.Errorf("Failed Prefix or unit: Want MF/s, Got %s", s)
}
}