xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/i86xpv/xdt/tst.hvmenable.ksh (revision c7158ae983f5a04c4a998f468ecefba6d23ba721)
1*c7158ae9Stariq#
2*c7158ae9Stariq# CDDL HEADER START
3*c7158ae9Stariq#
4*c7158ae9Stariq# The contents of this file are subject to the terms of the
5*c7158ae9Stariq# Common Development and Distribution License (the "License").
6*c7158ae9Stariq# You may not use this file except in compliance with the License.
7*c7158ae9Stariq#
8*c7158ae9Stariq# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*c7158ae9Stariq# or http://www.opensolaris.org/os/licensing.
10*c7158ae9Stariq# See the License for the specific language governing permissions
11*c7158ae9Stariq# and limitations under the License.
12*c7158ae9Stariq#
13*c7158ae9Stariq# When distributing Covered Code, include this CDDL HEADER in each
14*c7158ae9Stariq# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*c7158ae9Stariq# If applicable, add the following below this CDDL HEADER, with the
16*c7158ae9Stariq# fields enclosed by brackets "[]" replaced with your own identifying
17*c7158ae9Stariq# information: Portions Copyright [yyyy] [name of copyright owner]
18*c7158ae9Stariq#
19*c7158ae9Stariq# CDDL HEADER END
20*c7158ae9Stariq#
21*c7158ae9Stariq
22*c7158ae9Stariq#
23*c7158ae9Stariq# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*c7158ae9Stariq# Use is subject to license terms.
25*c7158ae9Stariq#
26*c7158ae9Stariq# ident	"%Z%%M%	%I%	%E% SMI"
27*c7158ae9Stariq#
28*c7158ae9Stariq
29*c7158ae9Stariq#
30*c7158ae9Stariq# ASSERTION: HVM probes should enable successfully.
31*c7158ae9Stariq#
32*c7158ae9Stariq
33*c7158ae9Stariqif [ $# != 1 ]; then
34*c7158ae9Stariq	echo expected one argument: '<'dtrace-path'>'
35*c7158ae9Stariq	exit 2
36*c7158ae9Stariqfi
37*c7158ae9Stariq
38*c7158ae9Stariq#
39*c7158ae9Stariq# Do not fail the test in a domU
40*c7158ae9Stariq#
41*c7158ae9Stariqif [ ! -c /dev/xen/privcmd ]; then
42*c7158ae9Stariq	exit 0
43*c7158ae9Stariqfi
44*c7158ae9Stariq
45*c7158ae9Stariqdtrace=$1
46*c7158ae9Stariq
47*c7158ae9Stariqscript()
48*c7158ae9Stariq{
49*c7158ae9Stariq	$dtrace -qs /dev/stdin <<EOF
50*c7158ae9Stariq	dtrace:::BEGIN
51*c7158ae9Stariq	{
52*c7158ae9Stariq		exit(0);
53*c7158ae9Stariq	}
54*c7158ae9Stariq
55*c7158ae9Stariq	xdt:hvm::vmentry,
56*c7158ae9Stariq	xdt:hvm::vmexit
57*c7158ae9Stariq	{}
58*c7158ae9StariqEOF
59*c7158ae9Stariq}
60*c7158ae9Stariq
61*c7158ae9Stariqscript
62*c7158ae9Stariqstatus=$?
63*c7158ae9Stariq
64*c7158ae9Stariqexit $status
65