@@ -78,42 +78,42 @@ def _test_parse_device_info(self, fixture_name):
7878
7979 # The device_info line should exist for every device
8080 device_info_found = any (
81- line .startswith ("device_info {" ) and
81+ line .startswith ("smartmon_device_info {" ) and
8282 f'disk="{ dev_name } "' in line and
8383 f'type="{ dev_iface } "' in line and
8484 f'serial_number="{ dev_serial } "' in line
8585 for line in metrics
8686 )
8787 self .assertTrue (
8888 device_info_found ,
89- f"Expected a device_info metric line for { dev_name } but didn't find it."
89+ f"Expected a smartmon_device_info metric line for { dev_name } but didn't find it."
9090 )
9191
9292 # If smart_capable is true, we expect device_smart_available = 1
9393 if device_info .get ("smart_capable" ):
9494 smart_available_found = any (
95- line .startswith ("device_smart_available {" ) and
95+ line .startswith ("smartmon_device_smart_available {" ) and
9696 f'disk="{ dev_name } "' in line and
9797 f'serial_number="{ dev_serial } "' in line and
9898 line .endswith (" 1.0" )
9999 for line in metrics
100100 )
101101 self .assertTrue (
102102 smart_available_found ,
103- f"Expected device_smart_available =1.0 for { dev_name } , not found."
103+ f"Expected smartmon_device_smart_available =1.0 for { dev_name } , not found."
104104 )
105105
106106 # If smart_enabled is true, we expect device_smart_enabled = 1
107107 if device_info .get ("smart_enabled" ):
108108 smart_enabled_found = any (
109- line .startswith ("device_smart_enabled {" ) and
109+ line .startswith ("smartmon_device_smart_enabled {" ) and
110110 f'disk="{ dev_name } "' in line and
111111 line .endswith (" 1.0" )
112112 for line in metrics
113113 )
114114 self .assertTrue (
115115 smart_enabled_found ,
116- f"Expected device_smart_enabled =1.0 for { dev_name } , not found."
116+ f"Expected smartmon_device_smart_enabled =1.0 for { dev_name } , not found."
117117 )
118118
119119 # device_smart_healthy if assessment in [PASS, WARN, FAIL]
@@ -122,14 +122,14 @@ def _test_parse_device_info(self, fixture_name):
122122 if assessment in ["PASS" , "WARN" , "FAIL" ]:
123123 expected_val = float (1 ) if assessment == "PASS" else float (0 )
124124 smart_healthy_found = any (
125- line .startswith ("device_smart_healthy {" ) and
125+ line .startswith ("smartmon_device_smart_healthy {" ) and
126126 f'disk="{ dev_name } "' in line and
127127 line .endswith (f" { expected_val } " )
128128 for line in metrics
129129 )
130130 self .assertTrue (
131131 smart_healthy_found ,
132- f"Expected device_smart_healthy ={ expected_val } for { dev_name } , not found."
132+ f"Expected smartmon_device_smart_healthy ={ expected_val } for { dev_name } , not found."
133133 )
134134
135135 def test_parse_device_info (self ):
@@ -164,7 +164,7 @@ def _test_parse_if_attributes(self, fixture_name):
164164
165165 if isinstance (attr_val , (int , float )) and snake_key in SMARTMON_ATTRS :
166166 expected_line = (
167- f"{ snake_key } {{disk=\" { dev_name } \" ,serial_number=\" { dev_serial } \" ,type=\" { dev_iface } \" }} { float (attr_val )} "
167+ f"smartmon_ { snake_key } {{disk=\" { dev_name } \" ,serial_number=\" { dev_serial } \" ,type=\" { dev_iface } \" }} { float (attr_val )} "
168168 )
169169 self .assertIn (
170170 expected_line ,
@@ -175,7 +175,7 @@ def _test_parse_if_attributes(self, fixture_name):
175175 # If it's not in SMARTMON_ATTRS or not numeric,
176176 # we do NOT expect a line with that name+value
177177 unexpected_line = (
178- f"{ snake_key } {{disk=\" { dev_name } \" ,serial_number=\" { dev_serial } \" ,type=\" { dev_iface } \" }} { float (attr_val )} "
178+ f"smartmon_ { snake_key } {{disk=\" { dev_name } \" ,serial_number=\" { dev_serial } \" ,type=\" { dev_iface } \" }} { float (attr_val )} "
179179 )
180180 self .assertNotIn (
181181 unexpected_line ,
@@ -268,8 +268,8 @@ def run_command_side_effect(cmd, parse_json=False):
268268 self .assertTrue (found , f"Expected metric '{ expected } ' not found" )
269269
270270 # Check that smartctl_version metric is present
271- version_found = any (line .startswith ("smartctl_version {" ) for line in metrics_lines )
272- self .assertTrue (version_found , "Expected 'smartctl_version ' metric not found in output file." )
271+ version_found = any (line .startswith ("smartmon_smartctl_version {" ) for line in metrics_lines )
272+ self .assertTrue (version_found , "Expected 'smartmon_smartctl_version ' metric not found in output file." )
273273
274274 # Check that the output file is not empty
275275 self .assertTrue (metrics_lines , "Metrics output file is empty." )
0 commit comments