@@ -221,14 +221,9 @@ class test_ucp_net_devices_config : public ucp_test {
221221 EXPECT_EQ (m_warnings.size () - warn_count, 1 )
222222 << " Expected exactly one warning" ;
223223
224- // print all warnings
225- for (const std::string &warn : m_warnings) {
226- std::cout << warn << std::endl;
227- }
228-
229224 /* Check that a warning about duplicate device was printed */
230225 std::string expected_warn = " device '" + duplicate_dev_name +
231- " ' was selected multiple times" ;
226+ " ' is specified multiple times" ;
232227 bool found_warning = false ;
233228 for (size_t i = warn_count; i < m_warnings.size (); ++i) {
234229 if (m_warnings[i].find (expected_warn) != std::string::npos) {
@@ -311,73 +306,6 @@ UCS_TEST_P(test_ucp_net_devices_config, explicit_port_suffix)
311306 << " Device '" << test_dev_name << " ' should be selected" ;
312307}
313308
314- /*
315- * Test that device name range specification works with base names.
316- * E.g., "mlx5_[0-1]" should match mlx5_0:1 and mlx5_1:1
317- */
318- UCS_TEST_P (test_ucp_net_devices_config, range_with_base_names)
319- {
320- entity *e = create_entity ();
321-
322- std::set<std::string> mlx5_devices = get_mlx5_device_names (*e);
323- if (mlx5_devices.empty ()) {
324- UCS_TEST_SKIP_R (" No mlx5 network device available" );
325- }
326-
327- size_t num_mlx5_devices = mlx5_devices.size ();
328- if (num_mlx5_devices < 2 ) {
329- UCS_TEST_SKIP_R (" Need at least 2 mlx5 devices for range test" );
330- }
331-
332- m_entities.clear ();
333-
334- /* Use a range that should match all mlx devices */
335- modify_config (" NET_DEVICES" , " mlx5_[0-99]" );
336- e = create_entity ();
337-
338- /* Verify that mlx5 devices were selected */
339- std::set<std::string> selected_devices = get_mlx5_device_names (*e);
340- EXPECT_EQ (selected_devices.size (), num_mlx5_devices)
341- << " Expected " << num_mlx5_devices
342- << " mlx5 devices to be selected with range" ;
343- }
344-
345- /*
346- * Test that a range not covering all devices only selects matching devices.
347- * E.g., "mlx5_[1-2]" should match mlx5_1 and mlx5_2, but not mlx5_0.
348- */
349- UCS_TEST_P (test_ucp_net_devices_config, partial_range_selection)
350- {
351- entity *e = create_entity ();
352-
353- std::set<std::string> mlx5_devices = get_mlx5_device_names (*e);
354- if (mlx5_devices.empty ()) {
355- UCS_TEST_SKIP_R (" No mlx5 network device available" );
356- }
357-
358- std::set<std::string> base_names = get_mlx5_base_names (mlx5_devices);
359-
360- if (!has_device (base_names, " mlx5_0" ) ||
361- !has_device (base_names, " mlx5_1" ) ||
362- !has_device (base_names, " mlx5_2" )) {
363- UCS_TEST_SKIP_R (
364- " Need mlx5_0, mlx5_1, and mlx5_2 devices for this test" );
365- }
366-
367- m_entities.clear ();
368-
369- modify_config (" NET_DEVICES" , " mlx5_[1-2]" );
370- e = create_entity ();
371-
372- std::set<std::string> selected_devices = get_mlx5_device_names (*e);
373-
374- std::set<std::string> selected_base_names = get_mlx5_base_names (
375- selected_devices);
376-
377- std::set<std::string> expected_base_names = {" mlx5_1" , " mlx5_2" };
378- EXPECT_EQ (selected_base_names, expected_base_names);
379- }
380-
381309/*
382310 * Test that specifying a device multiple times produces a warning
383311 */
@@ -388,23 +316,12 @@ UCS_TEST_P(test_ucp_net_devices_config, duplicate_device_warning_simple)
388316
389317UCS_TEST_P (test_ucp_net_devices_config, duplicate_device_warning_base_name)
390318{
391- test_duplicate_device_warning (" mlx5_0:1,mlx5_0" , " mlx5_0:1 " );
319+ test_duplicate_device_warning (" mlx5_0:1,mlx5_0" , " mlx5_0" );
392320}
393321
394322UCS_TEST_P (test_ucp_net_devices_config, duplicate_device_warning_two_base_name)
395323{
396- test_duplicate_device_warning (" mlx5_0,mlx5_0" , " mlx5_0:1" );
397- }
398-
399- UCS_TEST_P (test_ucp_net_devices_config, duplicate_device_warning_range)
400- {
401- test_duplicate_device_warning (" mlx5_[0-99],mlx5_0" , " mlx5_0:1" );
402- }
403-
404- UCS_TEST_P (test_ucp_net_devices_config, duplicate_device_warning_two_ranges)
405- {
406- test_duplicate_device_warning (" mlx5_[0-1],mlx5_[1-2]" , " mlx5_1:1" );
324+ test_duplicate_device_warning (" mlx5_0,mlx5_0" , " mlx5_0" );
407325}
408326
409-
410327UCP_INSTANTIATE_TEST_CASE_TLS (test_ucp_net_devices_config, ib, " ib" )
0 commit comments