mirror of
				https://github.com/prometheus/node_exporter.git
				synced 2025-08-20 18:33:52 -07:00 
			
		
		
		
	Fix tests
This commit is contained in:
		
							parent
							
								
									eb17b5fc9d
								
							
						
					
					
						commit
						7cb4c0edb6
					
				|  | @ -9,8 +9,8 @@ import ( | ||||||
| const ( | const ( | ||||||
| 	loadExpected = 0.21 | 	loadExpected = 0.21 | ||||||
| 
 | 
 | ||||||
| 	memTotalExpected       = "3742148" | 	memTotalExpected       = 3831959552 | ||||||
| 	memDirectMap2MExpected = "3698688" | 	memDirectMap2MExpected = 3787456512 | ||||||
| 
 | 
 | ||||||
| 	interruptsNmi1Expected = "5031" | 	interruptsNmi1Expected = "5031" | ||||||
| 
 | 
 | ||||||
|  | @ -51,11 +51,11 @@ func TestMemInfo(t *testing.T) { | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		t.Fatal(err) | 		t.Fatal(err) | ||||||
| 	} | 	} | ||||||
| 	if memInfo["MemTotal_kB"] != memTotalExpected { | 	if memInfo["MemTotal"] != memTotalExpected { | ||||||
| 		t.Fatalf("Unexpected memory: %s != %s", memInfo["MemTotal_kB"], memTotalExpected) | 		t.Fatalf("Unexpected memory: %s != %s", memInfo["MemTotal"], memTotalExpected) | ||||||
| 	} | 	} | ||||||
| 	if memInfo["DirectMap2M_kB"] != memDirectMap2MExpected { | 	if memInfo["DirectMap2M"] != memDirectMap2MExpected { | ||||||
| 		t.Fatalf("Unexpected memory: %s != %s", memInfo["MemTotal_kB"], memTotalExpected) | 		t.Fatalf("Unexpected memory: %s != %s", memInfo["MemTotal"], memTotalExpected) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  | @ -105,14 +105,13 @@ func TestDiskStats(t *testing.T) { | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		t.Fatal(err) | 		t.Fatal(err) | ||||||
| 	} | 	} | ||||||
| 
 | 	if diskStats["sda4"][0] != diskSda4ReadsCompleted { | ||||||
| 	if diskStats["sda4"]["reads_completed"] != diskSda4ReadsCompleted { | 		t.Fatalf("Unexpected diskstats: %s != %s", diskStats["sda4"][0], | ||||||
| 		t.Fatalf("Unexpected diskstats: %s != %s", diskStats["sda4"]["reads_completed"], |  | ||||||
| 			diskSda4ReadsCompleted) | 			diskSda4ReadsCompleted) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if diskStats["mmcblk0p2"]["io_time_weighted"] != diskMmcIoTimeWeighted { | 	if diskStats["mmcblk0p2"][10] != diskMmcIoTimeWeighted { | ||||||
| 		t.Fatalf("Unexpected diskstats: %s != %s", | 		t.Fatalf("Unexpected diskstats: %s != %s", | ||||||
| 			diskStats["mmcblk0p2"]["io_time_weighted"], diskMmcIoTimeWeighted) | 			diskStats["mmcblk0p2"][10], diskMmcIoTimeWeighted) | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue