Commit d45017f7 authored by Kevin Tew's avatar Kevin Tew

testsuite testswap fix 5.8.8 and bsd issues

parent 5c98c4a8
#!/usr/bin/perl
use Modern::Perl;
use inc::Module::Install;
# Define metadata
name 'tbts';
all_from 'lib/TestBed/XMLRPC/Client.pm';
perl_version '5.010';
perl_version '5.008';
author 'Kevin Tew <tewk@flux.utah.edu>';
version '0.01';
# Specific dependencies
requires 'Crypt::SSLeay' => '';
requires 'File::Spec' => '0.80';
requires 'Carp' => '1.08';
requires 'Modern::Perl' => '1.03';
requires 'Mouse' => '0.19';
requires 'RPC::XML::Client' => '1.24';
requires 'RPC::XML' => '1.41';
requires 'Sys::Hostname' => '1.11';
requires 'Test::More' => '0.86';
requires 'Time::Local' => '1.1901';
requires 'TAP::Harness' => '3.16';
requires 'Math::BigInt::GMP' => '';
requires 'Math::BigInt::Pari' => '';
requires 'Net::SSH::Perl' => '1.34';
requires 'Net::SFTP' => '0.10';
requires 'Crypt::X509' => '0.32';
requires 'Log::Log4perl' => '1.20';
requires 'Log::Dispatch::File' => '1.22';
requires 'Data::UUID' => '';
requires 'bignum' => '0.23';
requires 'Math::BigRat' => '0.22';
requires 'Crypt::SSLeay' => '';
requires 'Test::Exception' => '';
requires 'Sub::Uplevel' => '';
requires 'Mouse' => '';
requires 'RPC::XML::Client' => '1.24';
requires 'RPC::XML' => '1.41';
requires 'Sys::Hostname' => '1.11';
requires 'Test::More' => '0.86';
requires 'Time::Local' => '1.1901';
requires 'TAP::Harness' => '3.16';
requires 'Math::BigInt::GMP' => '';
requires 'Math::BigInt::Pari' => '';
requires 'Net::SSH::Perl' => '1.34';
requires 'Net::SFTP' => '0.10';
requires 'Crypt::X509' => '0.32';
requires 'Log::Log4perl' => '1.20';
requires 'Log::Dispatch::File' => '1.22';
requires 'Data::UUID' => '';
requires 'Net::Ping' => '';
test_requires 'Test::More' => '0.42';
no_index 'directory' => 'demos';
......
use Modern::Perl;
use SemiModern::Perl;
package TBConfig;
use Sys::Hostname;
......
our $VERSION = '1.00';
use 5.008_000;
use strict;
use warnings;
package SemiModern::Perl;
use IO::Handle;
use Scalar::Util 'openhandle';
use Carp;
sub say {
my $currfh = select();
my $handle;
{
no strict 'refs';
$handle = openhandle($_[0]) ? shift : \*$currfh;
use strict 'refs';
}
@_ = $_ unless @_;
my $warning;
local $SIG{__WARN__} = sub { $warning = join q{}, @_ };
my $res = print {$handle} @_, "\n";
return $res if $res;
$warning =~ s/[ ]at[ ].*//xms;
croak $warning;
}
if (1 || $] < 5.010) {
*IO::Handle::say = \&say if ! defined &IO::Handle::say;
}
sub import {
warnings->import();
strict->import();
if (1 || $] < 5.010) {
no strict 'refs';
*{caller() . '::say'} = \&say;
use strict 'refs';
}
}
1;
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
package TestBed::TestSuite::Experiment;
use Mouse;
......
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
package TestBed::TestSuite::Experiment::Macros;
use Data::Dumper;
......
#!/usr/bin/perl
use Modern::Perl;
package TestBed::XMLRPC::Client;
use SemiModern::Perl;
use Mouse;
use RPC::XML::Client;
use TBConfig;
......
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
package TestBed::XMLRPC::Client::Emulab;
use Mouse;
......
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
package TestBed::XMLRPC::Client::Experiment;
use Mouse;
......
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
package TestBed::XMLRPC::Client::NodeInfo;
require Exporter;
......
use Modern::Perl;
package Tools;
use SemiModern::Perl;
use Log::Log4perl qw(get_logger :levels);
#use Log::Log4perl::Appender::Screen
#use Log::Log4perl::Appender::ScreenColoredLevels
......@@ -45,7 +44,7 @@ sub sayts {
}
sub perlit {
map {_perlit($_)} @_;
map {_perlit($_)} @_;
}
sub toperl {
......
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
use Net::Ping;
package Tools::PingTest;
require Exporter;
......@@ -9,8 +10,8 @@ use Data::Dumper;
sub ping {
my ($host) = @_;
system("ping -c 3 -W 1 -w 5 $host");
$?;
my $p = Net::Ping->new('tcp', 2);
$p->ping($host);
}
1;
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
use Net::SSH::Perl;
use Net::SFTP;
use Data::UUID;
......@@ -11,7 +11,6 @@ sub uuid {
my $ug = new Data::UUID;
my $uuid = $ug->create_hex();
$uuid =~ s/^0x//;
say $uuid;
$uuid;
}
......
#!/usr/bin/perl
use Modern::Perl;
use lib 'lib';
use SemiModern::Perl;
use TestBed::TestSuite::Experiment::Macros;
use Data::Dumper;
use Tools::TBSSH;
......@@ -27,11 +27,8 @@ sub output {
while(my ($gk, $v) = each %$v) {
for my $e (@$v) {
my $eid;
given ($e) {
when('name') { $eid = sprintf("%s %s", $e->{'name'}, $e->{'state'});}
default { $eid = $e; }
};
if ( exists $e->{'name'} ) { $eid = sprintf("%s %s", $e->{'name'}, $e->{'state'});}
else { $eid = $e; }
say "$pk :: $gk :: $eid";
}
}
......
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
use TestBed::XMLRPC::Client::Emulab;
use Test::More tests => 3;
......
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
use TestBed::TestSuite::Experiment::Macros tests => 3;
use Test::More;
use Data::Dumper;
......
#/usr/bin/perl
use Modern::Perl;
use strict;
use warnings;
use TAP::Harness;
use Data::Dumper;
my %args = (
......
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
use TestBed::TestSuite::Experiment;
use Test::More qw(no_plan);
use Data::Dumper;
......
#!/usr/bin/perl
use Modern::Perl;
use SemiModern::Perl;
use TestBed::TestSuite::Experiment;
use Test::More tests => 1;
use Data::Dumper;
......
#!/usr/bin/perl
use Modern::Perl;
use lib 'lib';
use SemiModern::Perl;
use Data::Dumper;
{
......@@ -17,7 +18,7 @@ use Data::Dumper;
if ($pjobs > 1) {
$ENV{'HARNESS_OPTIONS'} = "j$pjobs";
}
if ($timing > 1) {
if ($timing) {
$ENV{'HARNESS_TIMER'} = 1;
}
if ($verbose) {
......@@ -25,23 +26,34 @@ use Data::Dumper;
$ENV{HARNESS_COLOR} = 1;
}
}
my $THARNESS = 'perl t/harness';
my $usage = <<"USAGE";
sub usage {
our $ts;
sub wanted {
if (-f && /\.t$/) {
$ts .= " " . $File::Find::name . "\n";
}
}
use File::Find;
find(\&wanted, 't');
print <<"USAGE";
./tbts
test
t/SPECIFIC_TEST.t
USAGE
print $ts;
}
if (@ARGV) {
my $cmd = $ARGV[0];
my $_ = $cmd;
$_ = $cmd;
if (/critic/) { exec 'perlcritic .'; }
elsif (/test/) { exec $THARNESS; }
elsif (/test/) { exec "$THARNESS t/topologies/*.t"; }
elsif (/.*\.t$/) { exec "$THARNESS $cmd"; }
}
else {
print $usage;
print usage();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment