Skip to content

Commit d262967

Browse files
committed
Add nft-dump utility for firewall test verification
- Create nft-dump Go utility that uses nftables library to inspect firewall rules without requiring nft CLI. Outputs human-readable YAML with interpreted values (IP addresses, ports, marks, etc.) - Update Garden firewall tests to use nft-dump instead of nft CLI for verifying firewall rules work correctly in containers - Fix Jammy stemcell container tests by unmounting Garden's bind-mounted /etc/resolv.conf, /etc/hosts, /etc/hostname before starting the agent. This prevents the 'Device or resource busy' error when the agent runs resolvconf -u (same approach used by bosh-warden-cpi) - Add nft-dump helper methods to GardenClient and TestEnvironment for use in both container and VM-based integration tests - Update deploy-to-noble.sh to build nft-dump binary for container tests Tests now pass for both Noble and Jammy stemcells.
1 parent 8e30313 commit d262967

7 files changed

Lines changed: 1240 additions & 317 deletions

File tree

deploy-to-noble.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ instance_groups:
113113
- name: ${INSTANCE_GROUP}
114114
azs: [z1]
115115
instances: 1
116-
vm_type: default
116+
vm_type: garden-test
117117
stemcell: stemcell
118118
networks:
119119
- name: default
@@ -207,6 +207,8 @@ show_help() {
207207
echo " INSTANCE_GROUP - Instance group name (default: agent-test)"
208208
echo " INSTANCE_ID - Instance ID (default: 0)"
209209
echo " GARDEN_RUNC_RELEASE_PATH - Path to garden-runc-release (default: ~/workspace/garden-runc-release)"
210+
echo " STEMCELL_IMAGE - Specific stemcell image to test (default: tests both Noble and Jammy)"
211+
echo " Example: STEMCELL_IMAGE=docker://ghcr.io/cloudfoundry/ubuntu-jammy-stemcell:latest"
210212
}
211213

212214
# Check Garden status
@@ -240,6 +242,10 @@ run_garden_tests() {
240242
cd "$SCRIPT_DIR"
241243
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o bosh-agent-linux-amd64 ./main
242244

245+
# Build nft-dump utility for inspecting nftables without nft CLI
246+
log_info "Building nft-dump utility for container tests..."
247+
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o nft-dump-linux-amd64 ./integration/nftdump
248+
243249
# Determine SSH key path for agent VM
244250
local ssh_key_path
245251
if [[ -f "${SCRIPT_DIR}/debug-ssh-key" ]]; then

0 commit comments

Comments
 (0)