xref: /onnv-gate/usr/src/cmd/dtrace/test/tst/common/sysevent/tst.post.d (revision 4926:0c0bcae7290e)
13490Seschrock /*
23490Seschrock  * CDDL HEADER START
33490Seschrock  *
43490Seschrock  * The contents of this file are subject to the terms of the
53490Seschrock  * Common Development and Distribution License (the "License").
63490Seschrock  * You may not use this file except in compliance with the License.
73490Seschrock  *
83490Seschrock  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93490Seschrock  * or http://www.opensolaris.org/os/licensing.
103490Seschrock  * See the License for the specific language governing permissions
113490Seschrock  * and limitations under the License.
123490Seschrock  *
133490Seschrock  * When distributing Covered Code, include this CDDL HEADER in each
143490Seschrock  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153490Seschrock  * If applicable, add the following below this CDDL HEADER, with the
163490Seschrock  * fields enclosed by brackets "[]" replaced with your own identifying
173490Seschrock  * information: Portions Copyright [yyyy] [name of copyright owner]
183490Seschrock  *
193490Seschrock  * CDDL HEADER END
203490Seschrock  */
213490Seschrock /*
223490Seschrock  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
233490Seschrock  * Use is subject to license terms.
243490Seschrock  */
253490Seschrock 
263490Seschrock #pragma ident	"%Z%%M%	%I%	%E% SMI"
273490Seschrock 
283490Seschrock #pragma D option quiet
293490Seschrock 
303490Seschrock BEGIN
313490Seschrock {
323490Seschrock 	$1 + 0;	/* make sure pid is referenced */
333490Seschrock 
34*4926Sjhaslam 	/*
35*4926Sjhaslam 	 * Wait no more than a five seconds for the sysevent to be posted
36*4926Sjhaslam 	 */
37*4926Sjhaslam 	timeout = timestamp + 5000000000;
383490Seschrock }
393490Seschrock 
403490Seschrock sysevent:::post
413490Seschrock /args[0]->ec_name != NULL/
423490Seschrock {
433490Seschrock 	printf("channel name is non-NULL (%s)\n",
443490Seschrock 	    args[0]->ec_name);
453490Seschrock 	exit(1);
463490Seschrock }
473490Seschrock 
483490Seschrock sysevent:::post
493490Seschrock /strstr(args[1]->se_publisher, "vendor_dtest") == NULL/
503490Seschrock {
513490Seschrock 	printf("missing vendor name from publisher (%s)\n",
523490Seschrock 	    args[1]->se_publisher);
533490Seschrock 	exit(1);
543490Seschrock }
553490Seschrock 
563490Seschrock sysevent:::post
573490Seschrock /strstr(args[1]->se_publisher, "publisher_dtest") == NULL/
583490Seschrock {
593490Seschrock 	printf("missing publisher name from publisher (%s)\n",
603490Seschrock 	    args[1]->se_publisher);
613490Seschrock 	exit(1);
623490Seschrock }
633490Seschrock 
643490Seschrock sysevent:::post
653490Seschrock /args[1]->se_class != "class_dtest"/
663490Seschrock {
673490Seschrock 	printf("unexpected class name (%s)\n", args[1]->se_class);
683490Seschrock 	exit(1);
693490Seschrock }
703490Seschrock 
713490Seschrock sysevent:::post
723490Seschrock /args[1]->se_subclass != "subclass_dtest"/
733490Seschrock {
743490Seschrock 	printf("unexpected subclass name (%s)\n", args[1]->se_subclass);
753490Seschrock 	exit(1);
763490Seschrock }
773490Seschrock 
783490Seschrock sysevent:::post
793490Seschrock {
803490Seschrock 	exit(0);
813490Seschrock }
823490Seschrock 
833490Seschrock profile:::tick-8
843490Seschrock /timestamp > timeout/
853490Seschrock {
86*4926Sjhaslam 	printf("timed out\n");
87*4926Sjhaslam 	exit(1);
883490Seschrock }
89