Commit cf106fbc authored by Christopher Alfeld's avatar Christopher Alfeld
Browse files

A nice complex topology. Includes checks on the virt_nodes and

virt_lans table.
parent 3a3f1a4f
This is the first test that checks the sanity of the database.
It only checks the virt_lans and virt_nodes tables.
source tb_compat.tcl
set ns [new Simulator]
set node1 [$ns node]
set node2 [$ns node]
set node3 [$ns node]
set node4 [$ns node]
set node5 [$ns node]
set node6 [$ns node]
set lan3 [$ns make-lan "$node1 $node2 $node3" 100Mb 100ms]
set lan2 [$ns make-lan "$node4 $node3" 100Mb 50ms]
set link1 [$ns duplex-link $node4 $node5 100Mb 0ms DropTail]
set link2 [$ns duplex-link $node4 $node5 100Mb 0ms DropTail]
tb-set-link-loss $link2 0.05
set link3 [$ns duplex-link $node6 $node5 100Mb 0ms DropTail]
set link4 [$ns duplex-link $node6 $node1 45Mb 1000ms DropTail]
$ns run
tb_prerun("tbprerun",0);
# Check DB state.
@result = (
["link2","0","100","0.025","node4:2"],
["link2","0","100","0.025","node5:1"],
["link3","0","100","0.000","node6:0"],
["link3","0","100","0.000","node5:2"],
["lan2","25","100","0.000","node4:0"],
["lan2","25","100","0.000","node3:1"],
["link4","500","45","0.000","node6:1"],
["link4","500","45","0.000","node1:1"],
["lan3","50","100","0.000","node1:0"],
["lan3","50","100","0.000","node2:0"],
["lan3","50","100","0.000","node3:0"],
["link1","0","100","0.000","node4:1"],
["link1","0","100","0.000","node5:0"],
);
tb_compare("SELECT vname,delay,bandwidth,lossrate,member from virt_lans" .
" where pid=\"testbed\" and eid=\"test\"",
\@result);
@result = (
["0:192.168.5.2 1:192.168.4.3","node1","pc"],
["0:192.168.5.3","node2","pc"],
["0:192.168.5.4 1:192.168.3.3","node3","pc"],
["0:192.168.3.2 1:192.168.6.2 2:192.168.1.2","node4","pc"],
["0:192.168.6.3 1:192.168.1.3 2:192.168.2.3","node5","pc"],
["0:192.168.2.2 1:192.168.4.2","node6","pc"],
);
tb_compare("SELECT ips,vname,type from virt_nodes" .
" where pid=\"testbed\" and eid=\"test\"",
\@result);
tb_run("tbswapin",0);
tb_run("tbswapout",0);
tb_run("tbswapin",0);
tb_run("tbswapout",0);
tb_run("tbend",0);
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