changed interfaces used for tests

This commit is contained in:
Brandon Heller committed 2008-03-20 02:29:21 +00:00
1 parent 3ac36b0f58
commit 4b4cb86cef
3 files changed
+12 -11

No files matched your search

+1 -3
View File
@@ -2,8 +2,6 @@
use strict;
my $OPENFLOW_DIR='~/openflow-v0.1.7';
sub trim($)
{
my $string = shift;
@@ -24,10 +22,10 @@ print "tearing down interfaces and datapaths\n";
# cleanup by deleting data paths, removing kmod, and killing controller
# should really make this smarter, but ah well
`dpctl delif 0 eth1`;
`dpctl delif 0 eth2`;
`dpctl delif 0 eth3`;
`dpctl delif 0 eth4`;
`dpctl delif 0 eth5`;
`dpctl deldp 0`;
my $of_kmod_removed = `rmmod openflow_mod`;
@@ -1,10 +1,13 @@
#!/usr/bin/perl
sub setup {
# check that we're root?
# if ($EUID == 0) {
# eventually should add byte counters
# verify kernel module not loaded
# ensure all interfaces use an address
for (my $i = 1; $i <= 8; $i++) {
`/sbin/ifconfig eth$i 192.168.$i.1`;
}
# verify kernel module not loaded
my $of_kmod_loaded = `lsmod | grep openflow_mod`;
if ($of_kmod_loaded eq "") {
print "loading kernel module\n";
@@ -30,10 +33,10 @@ sub setup {
# create openflow switch on four ports
`insmod ${openflow_dir}/datapath/linux-2.6/openflow_mod.ko`;
`dpctl adddp 0`;
`dpctl addif 0 eth1`;
`dpctl addif 0 eth2`;
`dpctl addif 0 eth3`;
`dpctl addif 0 eth4`;
`dpctl addif 0 eth5`;
}
setup();
@@ -8,7 +8,7 @@ use IO::Socket;
use strict;
# sending/receiving interfaces - NOT OpenFlow ones
my @interfaces = ("eth6", "eth7", "eth8", "eth9");
my @interfaces = ("eth5", "eth6", "eth7", "eth8");
my (%init_counters, %final_counters, %delta);
@@ -49,10 +49,10 @@ else {
# send one packet; controller should learn MAC, add a flow
# entry, and send this packet out the other interfaces
print "Sending now: \n";
send_and_count('eth6', $pkt->packed, \%delta);
send_and_count('eth5', $pkt->packed, \%delta);
expect_and_count('eth6', $pkt->packed, \%delta);
expect_and_count('eth7', $pkt->packed, \%delta);
expect_and_count('eth8', $pkt->packed, \%delta);
expect_and_count('eth9', $pkt->packed, \%delta);
# sleep as long as needed for the test to finish
sleep 0.5;