From 309a2c0b3c851eb0e50348b2d2a849998ba3e3b4 Mon Sep 17 00:00:00 2001 From: Justin SB Date: Sun, 22 Jan 2023 11:30:29 -0500 Subject: [PATCH] tests: Capture iptables chains This is helpful debugging information when we see network issues. --- pkg/dump/dumper.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/dump/dumper.go b/pkg/dump/dumper.go index fc28636cfe..55ea4e4f81 100644 --- a/pkg/dump/dumper.go +++ b/pkg/dump/dumper.go @@ -292,6 +292,14 @@ func (n *logDumperNode) dump(ctx context.Context) []error { } } + // Capture iptables configuration + if err := n.shellToFile(ctx, "sudo iptables -t nat --list-rules", filepath.Join(n.dir, "iptables-nat.log")); err != nil { + errors = append(errors, err) + } + if err := n.shellToFile(ctx, "sudo iptables -t filter --list-rules", filepath.Join(n.dir, "iptables-filter.log")); err != nil { + errors = append(errors, err) + } + // Capture any file logs where the files exist fileList, err := n.findFiles(ctx, "/var/log") if err != nil {