# File covered: evlAct.c

if {[lsearch [namespace children] ::tcltest] == -1} {
  package require tcltest
  namespace import -force ::tcltest::*
}

lappend TESTS [  list 	evlAct-0 \
			{srcip} \
		{ { protocol:tcp; srcip:192.168.1.1; } } \
		{ tcp 192.168.1.1 any -> any any ( ) drop; } \
		{} ] 

# no rules are appliable -> pkt is silently dropped
lappend TESTS [  list 	evlAct-1 \
			{srcip} \
		{ { protocol:tcp; srcip:192.168.1.1; } } \
		{ tcp 192.168.1.2 any -> any any ( ) drop; } \
		{} ] 

set ineth {eth1}
set outeth {eth2}
set numIterations 1
set maxNumPktsToRead 1
set ppCacheSize 1000

### TEST LOOP

foreach aTest $TESTS {
  set testId [lindex $aTest 0]
  set testLabel [lindex $aTest 1]
  if { 1 || [regexp {0} $testId ] } {
    puts "Running $testId\t($testLabel)"
    puts $aTest

    set pktTxt [lindex $aTest 2]
    puts "pkt test is $pktTxt"
    set mgrText [lindex $aTest 3]
    set expectedResult [lindex $aTest 4]

    set pkt [createPktArrayFromText $pktTxt]
    set mgr [evlBuildManagerFromText $mgrText]

    test $testId $testLabel {evlRoute $mgr $pkt}  $expectedResult
  }
}