use IO::Socket::INET;
#use Data::Dumper;
+use Osstest;
+use Osstest::TestSupport;
+use Osstest::Executive;
+
BEGIN {
use Exporter ();
our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
$VERSION = 1.00;
@ISA = qw(Exporter);
- @EXPORT = qw();
- %EXPORT_TAGS = (
- );
+ @EXPORT = qw(get_harness_rev grabrepolock_reexec
+ findtask @all_lock_tables
+ tcpconnect_queuedaemon plan_search
+ alloc_resources alloc_resources_rollback_begin_work
+ resource_check_allocated resource_shared_mark_ready
+ duration_estimator
+ opendb_state
+ );
+ %EXPORT_TAGS = ( );
@EXPORT_OK = qw();
}
# Nontransactional reads are also permitted
# Transactional reads must take out locks as if they were modifying
-
-BEGIN {
- use Exporter ();
- our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
- $VERSION = 1.00;
- @ISA = qw(Exporter);
- @EXPORT = qw(dbfl_check get_harness_rev grabrepolock_reexec
- findtask @all_lock_tables
- tcpconnect_queuedaemon plan_search
- alloc_resources alloc_resources_rollback_begin_work
- resource_check_allocated resource_shared_mark_ready
- duration_estimator
- opendb_state
- );
- %EXPORT_TAGS = ( );
-
- @EXPORT_OK = qw();
-}
-
augmentconfigdefaults(
ControlDaemonHost => 'woking.cam.xci-test.com',
OwnerDaemonPort => 4031,
WHERE restype='host' AND resname=?
END
$q->execute($name);
- foreach my ($row = $q->fetchrow_hashref()) {
+ while (my $row = $q->fetchrow_hashref()) {
my $name = $row->{name};
- $hp{propname_massage($name)} = $row->{val};
+ $hp->{propname_massage($name)} = $row->{val};
}
}
END
$sth->execute($selname);
my $row= $sth->fetchrow_hashref();
- die "$ident $name $selname ?" unless $row;
+ my $name= $ho->{Name};
+ die "$ho->{Ident} $name $selname ?" unless $row;
die if $sth->fetchrow_hashref();
$sth->finish();
my $get= sub {
use strict;
use warnings;
+use Osstest;
+use Osstest::TestSupport;
use Osstest::Executive;
BEGIN {
our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
$VERSION = 1.00;
@ISA = qw(Exporter);
- @EXPORT = qw();
+ @EXPORT = qw(dbfl_check);
%EXPORT_TAGS = ( );
@EXPORT_OK = qw();
}
-sub new { return bless {}, Osstest::JobDB::Standalone };
+sub new { return bless {}, $_[0] };
sub begin_work ($$$) { #method
my ($jd, $dbh,$tables) = @_;
}
}
-sub flight_create ($) { #method
- my ($jd) = @_;
+sub flight_create ($$$) { #method
+ my ($jd,$intended,$branch) = @_;
$dbh_tests->do(<<END, {}, $branch, $intended);
INSERT INTO flights
(flight, started, blessing, branch, intended)
WHERE flight=$flight AND blessing='constructing'
END
logm("starting $flight") if $count>0;
+ my $now = time;
$count= $dbh_tests->do(<<END);
UPDATE flights SET started=$now
sub host_check_allocated ($$) { #method
my ($jd, $ho) = @_;
- $ho->{Shared}= resource_check_allocated('host', $name);
+ $ho->{Shared}= resource_check_allocated('host', $ho->{Name});
$ho->{SharedReady}=
$ho->{Shared} &&
$ho->{Shared}{State} eq 'ready' &&
- !! grep { $_ eq "share-".$ho->{Shared}{Type} } get_hostflags($ident);
+ !! (grep { $_ eq "share-".$ho->{Shared}{Type} }
+ get_hostflags($ho->{Ident}));
$ho->{SharedOthers}=
$ho->{Shared} ? $ho->{Shared}{Others} : 0;
}
sub jobdb_resource_shared_mark_ready { #method
- my $mo = shift @_;
- resource_shared_mark_ready(@_);
+ my ($mo, $restype, $resname, $sharetype) = @_;
+ resource_shared_mark_ready($restype, $resname, $sharetype);
}
sub jobdb_check_other_job { #method