diff --git a/bin/killof.pl b/bin/killof.pl index 04522a2..1d89eed 100755 --- a/bin/killof.pl +++ b/bin/killof.pl @@ -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`; diff --git a/projects/learning_switch/regress/common/setup b/projects/learning_switch/regress/common/setup index 34b1c62..5e57eb5 100755 --- a/projects/learning_switch/regress/common/setup +++ b/projects/learning_switch/regress/common/setup @@ -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(); diff --git a/projects/learning_switch/regress/test_unicast_unknown/run.pl b/projects/learning_switch/regress/test_unicast_unknown/run.pl index 5242c1c..5cb5d22 100755 --- a/projects/learning_switch/regress/test_unicast_unknown/run.pl +++ b/projects/learning_switch/regress/test_unicast_unknown/run.pl @@ -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;