@@ -50,4 +50,53 @@ TEST(SysmanInitTests,
5050 }
5151}
5252
53+ TEST (SysmanInitTests,
54+ GivenSysmanInitWhenzesDeviceGetPropertiesReturnsSurvivabilityDetectedErrorThenOnlyFormwareAPIsSucceed) {
55+
56+ ze_result_t result = zesInit (0 );
57+ ASSERT_EQ (result, ZE_RESULT_SUCCESS);
58+ uint32_t zes_driver_count = 0 ;
59+ EXPECT_EQ (ZE_RESULT_SUCCESS, zesDriverGet (&zes_driver_count, nullptr ));
60+ EXPECT_GT (zes_driver_count, 0 );
61+ std::vector<zes_driver_handle_t > drivers (zes_driver_count);
62+ result = zesDriverGet (&zes_driver_count, drivers.data ());
63+ ASSERT_EQ (result, ZE_RESULT_SUCCESS);
64+ for (auto driver : drivers) {
65+ uint32_t device_count = 0 ;
66+ result = zesDeviceGet (driver, &device_count, nullptr );
67+ ASSERT_EQ (result, ZE_RESULT_SUCCESS);
68+ ASSERT_GT (device_count, 0 );
69+ std::vector<zes_device_handle_t > devices (device_count);
70+ result = zesDeviceGet (driver, &device_count, devices.data ());
71+ ASSERT_EQ (result, ZE_RESULT_SUCCESS);
72+ for (auto device : devices) {
73+ zes_device_properties_t properties = {ZES_STRUCTURE_TYPE_DEVICE_PROPERTIES, nullptr };
74+ result = zesDeviceGetProperties (device, &properties);
75+ EXPECT_EQ (result, ZE_RESULT_SUCCESS);
76+ uint32_t temp_count = 0 ;
77+ temp_count = lzt::get_temp_handle_count (device);
78+ if (temp_count == 0 ) {
79+ FAIL () << " No handles found: "
80+ << _ze_result_t (ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
81+ }
82+ uint32_t standby_count = 0 ;
83+ auto p_standby_handles = lzt::get_standby_handles (device, standby_count);
84+ for (auto p_standby_handle : p_standby_handles) {
85+ EXPECT_NE (nullptr , p_standby_handle);
86+ }
87+ uint32_t count = 0 ;
88+ count = lzt::get_firmware_handle_count (device);
89+ if (count == 0 ) {
90+ FAIL () << " No handles found: "
91+ <<_ze_result_t (ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
92+ }
93+ auto firmware_handles = lzt::get_firmware_handles (device, count);
94+ if (count == 0 ) {
95+ FAIL () << " No handles found: "
96+ << _ze_result_t (ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
97+ }
98+ }
99+ }
100+ }
101+
53102} // namespace
0 commit comments