[openib-general] [PATCH]osmtest/osmtest.c: Add more InformInfo/InformInfoRecord tests
Hal Rosenstock
halr at voltaire.com
Thu Dec 21 12:59:42 PST 2006
osmtest/osmtest.c: Add more InformInfo/InformInfoRecord tests
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
diff --git a/osm/osmtest/osmtest.c b/osm/osmtest/osmtest.c
index 355a6f9..6afa899 100644
--- a/osm/osmtest/osmtest.c
+++ b/osm/osmtest/osmtest.c
@@ -73,6 +73,7 @@ typedef struct _osmtest_inform_info
{
boolean_t subscribe;
ib_net32_t qpn;
+ ib_net16_t trap;
} osmtest_inform_info_t;
typedef struct _osmtest_inform_info_rec
@@ -4890,6 +4891,11 @@ osmtest_informinfo_request(
rec.g_or_v.generic.qpn_resp_time_val = cl_hton32(p_inform_info_opt->qpn) >> 8;
user.comp_mask |= IB_IIR_COMPMASK_QPN;
}
+ if (p_inform_info_opt->trap)
+ {
+ rec.g_or_v.generic.trap_num = cl_hton16(p_inform_info_opt->trap);
+ user.comp_mask |= IB_IIR_COMPMASK_TRAPNUMB;
+ }
user.p_attr = &rec;
}
user.method = method;
@@ -5973,12 +5979,63 @@ osmtest_validate_against_db( IN osmtest_
if ( status != IB_SUCCESS )
goto Exit;
+ /* Another subscription */
+ osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
+ "osmtest_informinfo_request: InformInfo "
+ "Sending another Good - Set Subscribe (again) request\n");
+ inform_info_opt.qpn = 0;
+ inform_info_opt.trap = 0x1234;
+ memset( &context, 0, sizeof( context ) );
+ status = osmtest_informinfo_request( p_osmt, IB_MAD_ATTR_INFORM_INFO,
+ IB_MAD_METHOD_SET, &inform_info_opt,
+ &context );
+ if ( status != IB_SUCCESS )
+ goto Exit;
+
+ /* Get all InformInfoRecords again */
+ osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
+ "osmtest_informinfo_request: InformInfoRecord "
+ "Sending a Good - GetTable (ALL records) request\n");
+ memset( &inform_info_rec_opt, 0, sizeof( inform_info_rec_opt ) );
+ memset( &context, 0, sizeof( context ) );
+ status = osmtest_informinfo_request( p_osmt, IB_MAD_ATTR_INFORM_INFO_RECORD,
+ IB_MAD_METHOD_GETTABLE,
+ &inform_info_rec_opt, &context );
+ if ( status != IB_SUCCESS )
+ goto Exit;
+
/* Cleanup subscriptions before further testing */
+ /* Does order of deletion matter ? Test this !!! */
osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
"osmtest_informinfo_request: InformInfo "
- "Sending a Good - Set (cleanup all of them) request\n");
+ "Sending a Good - Set (cleanup) request\n");
+ inform_info_opt.subscribe = FALSE;
+ inform_info_opt.qpn = 1;
+ memset( &context, 0, sizeof( context ) );
+ status = osmtest_informinfo_request( p_osmt, IB_MAD_ATTR_INFORM_INFO,
+ IB_MAD_METHOD_SET,
+ &inform_info_opt, &context );
+ if ( status != IB_SUCCESS )
+ goto Exit;
+
+ /* Get all InformInfoRecords again */
+ osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
+ "osmtest_informinfo_request: InformInfoRecord "
+ "Sending a Good - GetTable (ALL records) request\n");
+ memset( &inform_info_rec_opt, 0, sizeof( inform_info_rec_opt ) );
+ memset( &context, 0, sizeof( context ) );
+ status = osmtest_informinfo_request( p_osmt, IB_MAD_ATTR_INFORM_INFO_RECORD,
+ IB_MAD_METHOD_GETTABLE,
+ &inform_info_rec_opt, &context );
+ if ( status != IB_SUCCESS )
+ goto Exit;
+
+ osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
+ "osmtest_informinfo_request: InformInfo"
+ "Sending a Good - Set (cleanup) request\n");
inform_info_opt.subscribe = FALSE;
inform_info_opt.qpn = 1;
+ inform_info_opt.trap = 0;
memset( &context, 0, sizeof( context ) );
status = osmtest_informinfo_request( p_osmt, IB_MAD_ATTR_INFORM_INFO,
IB_MAD_METHOD_SET,
@@ -5986,6 +6043,18 @@ osmtest_validate_against_db( IN osmtest_
if ( status != IB_SUCCESS )
goto Exit;
+ /* Get all InformInfoRecords a final time */
+ osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
+ "osmtest_informinfo_request: InformInfoRecord "
+ "Sending a Good - GetTable (ALL records) request\n");
+ memset( &inform_info_rec_opt, 0, sizeof( inform_info_rec_opt ) );
+ memset( &context, 0, sizeof( context ) );
+ status = osmtest_informinfo_request( p_osmt, IB_MAD_ATTR_INFORM_INFO_RECORD,
+ IB_MAD_METHOD_GETTABLE,
+ &inform_info_rec_opt, &context );
+ if ( status != IB_SUCCESS )
+ goto Exit;
+
if (lmc != 0)
{
test_lid = cl_ntoh16( p_osmt->local_port.lid + 1 );
More information about the general
mailing list