#!/usr/bin/env perl
use
constant
Agent
=>
"WWW::Parallels::Agent"
;
plan +(
my
$hostname
=
$ENV
{PARALLELS_AGENT_HOSTNAME} )
? (
tests
=> 18 )
: (
skip_all
=>
"Environment variable PARALLELS_AGENT_HOSTNAME not set."
);
my
$agent
= Agent->new(
xsd_version
=> 4,
use_ssl
=> 0,
hostname
=>
$hostname
);
isa_ok(
$agent
, Agent);
can_ok(
$agent
,
qw(envm)
);
SKIP: {
eval
{ load XML::Compile::Tester };
skip
"XML::Compile::Tester not installed."
if
$@;
XML::Compile::Tester->
import
;
my
@operations
= (
{
create
=> {
config
=> { } } },
{
suspend
=> {
eid
=>
"..."
} },
{
resume
=> {
eid
=>
"..."
} },
{
destroy
=> {
eid
=>
"..."
} } );
foreach
(
@operations
) {
my
(
$function
,
$params
) = %{
$_
};
my
$writer
= writer_create(
$agent
->_schema,
"env-$function writer"
,
writer_test(
$writer
,
$params
); } }