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
# Check DB state.
@result = (
tb_compare("SELECT vname,delay,bandwidth,lossrate,member from virt_lans" .
" where pid=\"testbed\" and eid=\"test\"",
@result = (
["0: 1:","node1","pc"],
["0: 1:","node3","pc"],
["0: 1: 2:","node4","pc"],
["0: 1: 2:","node5","pc"],
["0: 1:","node6","pc"],
tb_compare("SELECT ips,vname,type from virt_nodes" .
" where pid=\"testbed\" and eid=\"test\"",
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