Add isolated SIP call tool, optional debug capture and split interface schemas
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestDebugFlagIsExplicitAndAgentOnly(t *testing.T) {
|
||||
for _, flag := range []string{"--debug", "-D"} {
|
||||
command := newAgentCommand()
|
||||
if err := command.ParseFlags([]string{flag}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
enabled, err := command.Flags().GetBool("debug")
|
||||
if err != nil || !enabled {
|
||||
t.Fatalf("%s: %v %v", flag, enabled, err)
|
||||
}
|
||||
if err := newDispatcherCommand().ParseFlags([]string{flag}); err == nil {
|
||||
t.Fatal("Dispatcher must not silently accept an Agent capture flag")
|
||||
}
|
||||
}
|
||||
command := newAgentCommand()
|
||||
enabled, err := command.Flags().GetBool("debug")
|
||||
if err != nil || enabled {
|
||||
t.Fatal("capture must be disabled by default")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user