1N/A# The contents of this file are subject to the terms of the 1N/A# Common Development and Distribution License (the "License"). 1N/A# You may not use this file except in compliance with the License. 1N/A# See the License for the specific language governing permissions 1N/A# and limitations under the License. 1N/A# When distributing Covered Code, include this CDDL HEADER in each 1N/A# If applicable, add the following below this CDDL HEADER, with the 1N/A# fields enclosed by brackets "[]" replaced with your own identifying 1N/A# information: Portions Copyright [yyyy] [name of copyright owner] 1N/A# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 1N/A# Tests for Sun::Solaris::Lgrp API. 1N/A# Before `make install' is performed this script should be runnable with 1N/A# `make test'. After `make install' it should work as `perl Lgrp.t' 1N/A# The test uses Test module which is available on Perl 5.6 and later. 1N/A###################################################################### 1N/A###################################################################### 1N/A# Check that all exported constants can be accessed. 1N/A######################### 1N/A###################################################################### 1N/A# Verify lgrp_version 1N/A####################################################################### 1N/A###################################################################### 1N/A# Verify that lgrp_init()/lgrp_fini work. 1N/A# Try to free it again, it should fail. 1N/A###################################################################### 1N/A###################################################################### 1N/A# root should have ID 0. 1N/A###################################################################### 1N/A# Verify lgrp_nlgrps() 1N/A###################################################################### 1N/A# All root children should have root as their one and only one parent 1N/A###################################################################### 1N/A# Illegal parents have no children 1N/A# Same in scalar context 1N/A###################################################################### 1N/A# root should have no parents. 1N/A# Same in scalar context 1N/A###################################################################### 1N/A# Illegal children have no paremts 1N/A# Same in scalar context 1N/A###################################################################### 1N/A# Root should have non-zero CPUs and memory size 1N/A###################################################################### 1N/A###################################################################### 1N/A# The cookie should not be stale 1N/A###################################################################### 1N/A###################################################################### 1N/A# Can we call lgrp_latency? 1N/A# The latencies from lgrp_latency and lgrp_latency_cookie should match. 1N/A###################################################################### 1N/A# Can we call lgrp_resources? 1N/A# lgrp_fini should always succeed. 1N/A###################################################################### 1N/A# Now test Object-Oriented interface. 1N/A die "Lgrp->new(LGRP_VIEW_OS): $!"; 1N/A die "Lgrp->new(LGRP_VIEW_CALLER): $!"; 1N/A print STDERR "# \@leaves: @leaves, \@leaves1: @leaves\n"; 1N/A print STDERR "# \@cpus: @cpus, \@cpus1: @cpus1\n"; 1N/A###################################################################### 1N/A# Can we call lgrp_home? 1N/A###################################################################### 1N/A# Can we call lgrp_affinity_set? 1N/A###################################################################### 1N/A# Can we call lgrp_affinity_get? 1N/A######################################################################