Next Topic

Previous Topic

Book Contents

Finding Tests Without Actions Assigned

This sample script lists all devices, then checks the action profile assigned to each test and prints out the ones which do not have any actions assigned.

$BVE = new Zyrion::Provisioning(Host=>"myhost");
$BVE->Login( user=>"joe", password=>"mypasswd");
$BVE->[ListDevice](deviceName=>"*");
my %DEVICE_LIST = ();
my $RESULT_REF  = $BVE->[GetResultRef]();
foreach my $device_serial (keys %{ $RESULT_REF }) {
my $device_name =
$RESULT_REF->{$device_serial}->{devicename};
$DEVICE_LIST{$device_serial} = $device_name;
}
## now scan through tests on each device
foreach my $device_serial (sort keys %DEVICE_LIST) {
$BVE->[ListTest](deviceName=>$DEVICE_LIST{$device_serial},
testName=>'*');
$RESULT_COUNT = $BVE->[GetResultCount]();
next unless ($RESULT_COUNT);
$RESULT_REF = $BVE->[GetResultRef]();
foreach my $test_serial (keys %{ $RESULT_REF }) {
my $action_profile =
$RESULT_REF->{$test_serial}->{actionname};
my $test_name = $RESULT_REF->{$test_serial}->{testname};
next unless (uc($action_profile) eq "NONE");
&info("device = $DEVICE_LIST{$device_serial} ; test = \'$test_name\'");
} # foreach test
} # foreach device
$BVE->Logout;