Commit 0e1c5761 authored by Kevin Tew's avatar Kevin Tew

testsuite/testswap more docs and simplification

parent f246595d
ssh-agent running with SSH emulab keys added
emulab client certificate and key set up correctly
cpan HAS to be configured and functional
cpan Module::Install
perl Makefile.PL
TO RUN Tests
make test
make t/old/old.t
make t/topologies/basic.t
Module::Install is a perl library for installing perl modules/frameworks like testswap
If you need help getting CPAN to run as non-root:
How to install Perl CPAN modules into my HOME directory?
Using CPAN with a non-root account
use SemiModern::Perl;
package TBConfig;
use SemiModern::Perl;
use Sys::Hostname;
use Crypt::X509;
use Tools qw(slurp);
-default run kill
buildup, teardown - Test::Class
Add parameterization examples
Add parse links from xmlserver
traffic generation`
test groupings
event system
convert more old tests
general result code handling
better parallel support
move xmlrpc tests to t/xmlrpc
Parse NodeInfo
testswap is a object orient / declarative test framework for the emulab testbed.
Core framework modules that the testwriter should use
The XMLRPC client interface that the core modules use to do their work
shouldn't be directly used by the testwriter
command line utility wrappers
utility modules and functions used by the framework
topology swap tests
xmlrpc tests
testswap framework tests
e('PROJECT_ID', 'EXPERIMENT_ID'); #new experiment
ep(); #new plain experiment for calling "class methods" on
dpe('EXPERIMENT_ID') #default project new experiment
./README - initial getting started doc
./ - global configuration values
./tbts - testbed testsuite driver
./sc - shortcut driver for interactive user
./lib/SemiModern/ - provides perl5.10 say to older perls
./lib/TestBed/ - provides e() ep() dpe() macros
./lib/TestBed/TestSuite/ - represents a emulab node
./lib/TestBed/TestSuite/ - represents a emulab project
./lib/TestBed/TestSuite/ - represents a emulab experiment
./lib/TestBed/TestSuite/Experiment/ - holds some obselete macros
./lib/TestBed/XMLRPC/ - XMLRPC utility classes
./lib/TestBed/XMLRPC/Client/ - XMLRPC pretty printers
./lib/TestBed/Wrap/ - tevc wrapper
./lib/TestBed/Wrap/ - linktest wrapper
./lib/ - utility functions
./lib/Tools/ - testbed ssh functions
./lib/Tools/ - network utility functions (ping traceroute)
./Makefile.PL - Module::Install makefile
./t/harness - perl test harness
./t/topologies/basic.t - basic topology test
./t/topologies/simple.t - simple topology test
./t/old/old.t - old testsuite tests
./t/old/ - old testsuite data
./t/emulab.t - emulab XMLRPC tests
./t/experiment.t - experiment XMLRPC tests
./t/lib - testswap framework tests
./t/lib/tools.t - testswap framework tools tests
./t/lib/tools/network.t - testswap framework network tests
package TestBed::TestSuite;
use SemiModern::Perl;
use TestBed::TestSuite::Experiment;
use Data::Dumper;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(e ep dpe);
sub ep { TestBed::TestSuite::Experiment->new }
sub e { TestBed::TestSuite::Experiment->new('pid'=> shift, 'eid' => shift) }
sub dpe { TestBed::TestSuite::Experiment->new('pid'=> $TBConfig::DEFAULT_PID, 'eid' => shift) }
......@@ -60,11 +60,22 @@ sub trytest(&$) {
sub startrunkill {
my ($e, $ns, $worker) = @_;
my $eid = $e->eid;
trytest {
$e->startexp_ns_wait($ns) && die "batchexp $eid failed";
$worker->($e) && die "worker function failed";
$e->end && die "exp end $eid failed";
} $e;
#class methods
sub launchpingkill {
my ($pid, $eid, $ns) = @_;
my $e = e($pid, $eid);
trytest {
$e->batchexp_ns_wait($ns) && die "batchexp $eid failed";
$e->startexp_ns_wait($ns) && die "batchexp $eid failed";
$e->ping_test && die "connectivity test $eid failed";
$e->end && die "exp end $eid failed";
} $e;
......@@ -74,7 +85,7 @@ sub launchpingswapkill {
my ($pid, $eid, $ns) = @_;
my $e = e($pid, $eid);
trytest {
$e->batchexp_ns_wait($ns) && die "batchexp $eid failed";
$e->startexp_ns_wait($ns) && die "batchexp $eid failed";
$e->ping_test && die "connectivity test $eid failed";
$e->swapout_wait && die "swap out $eid failed";
$e->swapin_wait && die "swap in $eid failed";
......@@ -82,4 +93,5 @@ sub launchpingswapkill {
$e->end && die "exp end $eid failed";
} $e;
......@@ -5,7 +5,8 @@ use Test::More qw(no_plan);
use Data::Dumper;
require 't/old/';
our @pass = qw(basic cbr complete5 delaylan1 delaylink);
our @who_knows = qw( ixp lan1 multilink nodes singlenode trafgen simplelink simplex setip red ping );
our @who_knows_passed = qw( lan1 multilink );
our @who_knows = qw( ixp lan1 nodes singlenode trafgen simplelink simplex setip red ping );
our @should_fail = qw(negprerun toomanylinks toofast);
......@@ -14,8 +15,10 @@ S fixed (you will have to change the ns file depending on which nodes are
for (@pass) {
say "Running " . $_;
#for (@pass) {
for (@who_knows) {
my $ns = $Testbed::OldTestSuite::data->{$_}->{'nsfile'};
ok(launchpingkill('tbres', $_, $ns));
say "Running " . $_;
say $ns;
ok(launchpingkill('tbres', $_, $ns), $_);
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