Commit ec7bb2f1 authored by Jonathon Duerig's avatar Jonathon Duerig

Integrated and fixed bugs in DummyNet backend. Added an automated testing script.

parent fe6d3694
This diff is collapsed.
......@@ -10,7 +10,7 @@ struct dn_pipe;
class DummynetPipe : public RootPipe
{
public:
DummynetPipe(std::string const & name);
DummynetPipe(std::string const & newPipeNumber);
virtual ~DummynetPipe();
virtual void reset(void);
virtual void resetParameter(Parameter const & newParameter);
......@@ -46,8 +46,6 @@ private:
class NetlinkPipe : public RootPipe
{
public:
// 'name' will be prefixed with "new-" plus the original agent's
// name. To call the old agent, simply remove the prefix.
NetlinkPipe(std::string const & iface, std::string const & pipeno);
virtual ~NetlinkPipe();
virtual void reset(void);
......
......@@ -7,6 +7,7 @@ using namespace std;
EventPipe::EventPipe(std::string const & name)
{
cerr << "Creating Event pipe" << endl;
agentName = name;
}
......
......@@ -23,10 +23,12 @@ struct PipeInfo
, parameters(g::defaultParameters)
, interface(newInterface)
, pipeData(newPipeData)
#if 0
, rawPipe(new EventPipe(linkName))
#else
#if defined LINUX
, rawPipe(new NetlinkPipe(newInterface, newPipeData))
#elif defined FREEBSD
, rawPipe(new DummynetPipe(newPipeData))
#else
, rawPipe(new EventPipe(linkName))
#endif
{
}
......
......@@ -2,8 +2,10 @@
#include "lib.hh"
#ifdef LINUX
#include <netlink/netlink.h>
#include <netlink/route/link.h>
#endif
using namespace std;
......
# Usage: run-test.sh <project>/<experiment> <link-name> <node1-name> <node2-name>
$exp = $ARGV[0];
$link = $ARGV[1];
$node1 = $ARGV[2];
$node2 = $ARGV[3];
sub sendEvent
{
my $source = shift @_;
my $params = shift @_;
my $command = "/usr/testbed/bin/tevc -e $exp now $source $params";
print $command . "\n";
system($command);
}
sub check
{
my $testname = shift @_;
sleep(5);
my $command;
$command = "ping -c 10 $node2-$link > test/$testname.ping.$link";
print $command . "\n";
system($command);
$command = "/proj/delay-agent/duerig/iperf -c $node2-$link -w 256k -t 60 > test/$testname.iperf.$link";
print $command . "\n\n";
system($command);
}
sendEvent($link, "MODIFY DELAY=30");
sendEvent($link, "MODIFY BANDWIDTH=1000");
sendEvent("$link-$node1", "MODIFY DELAY=10");
check("check1");
sendEvent("$link", "MODIFY DELAY=20 BANDWIDTH=500");
check("check2");
sendEvent("$link", "DOWN");
check("check3");
sendEvent("$link-$node2", "MODIFY DELAY=50");
sendEvent("$link-$node1", "MODIFY BANDWIDTH=6000");
sendEvent("$link", "UP");
check("check4");
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