(t *testing.T)
| 554 | } |
| 555 | |
| 556 | func TestGenerateNfqueueDropProbeJSON(t *testing.T) { |
| 557 | config := TraceConfig{ |
| 558 | EnableNfqueueDrops: true, |
| 559 | OutputJSON: true, |
| 560 | } |
| 561 | |
| 562 | gen := NewScriptGenerator(config) |
| 563 | script := gen.Generate() |
| 564 | |
| 565 | // Verify JSON output fields |
| 566 | if !strings.Contains(script, `\"type\":\"NFQ_DROP\"`) { |
| 567 | t.Error("JSON script missing NFQ_DROP type field") |
| 568 | } |
| 569 | if !strings.Contains(script, `\"queue\"`) { |
| 570 | t.Error("JSON script missing queue field") |
| 571 | } |
| 572 | if !strings.Contains(script, `\"errno\"`) { |
| 573 | t.Error("JSON script missing errno field") |
| 574 | } |
| 575 | if !strings.Contains(script, `\"probe\":\"__nf_queue\"`) { |
| 576 | t.Error("JSON script missing __nf_queue probe field") |
| 577 | } |
| 578 | } |
| 579 | |
| 580 | func TestGenerateNfqueueDropProbeWithIPFilter(t *testing.T) { |
| 581 | ip := net.ParseIP("10.0.0.1") |
nothing calls this directly
no test coverage detected