set test modinfo

set module [exec stap --modinfo foo=bar -p4 -e "probe begin { exit() }"]
if [file exists $module] { pass "$test compilation" } else { fail "$test compilation"; return }

set ok 0
set ko 0
spawn /sbin/modinfo $module
expect {
    -re {^foo:[ ]*bar\r\n} { incr ok; exp_continue }
    -re {^[a-zA-Z0-9_]*:[^\r\n]*\r\n} { exp_continue }
    eof { }
}
catch { close }; catch { wait }
if {$ok == 1} { pass "$test modinfo" } else { fail "$test modinfo ($ok $ko)" }
