Skip to content

TLS Test and E2E Strategy ​

Relevant source files

The following files were used as context for generating this wiki page:

Purpose and Scope ​

This page details the testing and End-to-End (E2E) verification strategy for eCapture's core TLS modules (tls for OpenSSL/BoringSSL, gotls for Go native TLS, and gnutls for GnuTLS). It covers targeted unit test patterns, byte-level ABI checks, race condition detection, production-tag gates, and strict Linux/Android E2E execution harnesses that validate text, keylog, and pcapng output modes.

Sources: test/e2e/README.md:1-76, test/e2e/linux/common.sh:1-76


6.2.1 Targeted Unit Tests and Byte-Level ABI Checks ​

Core TLS probes rely on precise binary structure inspection and ABI compatibility. Unit tests and configuration validators verify binary properties prior to eBPF program attachment:

Sources: internal/probe/gotls/config.go:114-228, test/e2e/linux/tls_test.sh:13-19


6.2.2 Race Conditions and Production-Tag Gates ​

To guarantee safety in concurrent user-space control loops and eBPF event ring buffers, the test suite enforces rigorous build and runtime checks:

  • Race Detector Integration: Go tests and components are executed under the Go race detector (-race) to catch concurrent map reads/writes in event dispatchers and output sinks.
  • Output Isolation and Conflict Gates: Test cases validate that eCapture strictly separates operational logging (--logaddr) from captured events (--eventaddr or stdout), rejecting conflicting parameters such as simultaneous stdout usage or invalid sink URI schemes test/e2e/linux/tls_test.sh:59-79.

Sources: test/e2e/linux/tls_test.sh:59-79, test/e2e/linux/gnutls_test.sh:36-56


6.2.3 Linux E2E Harness and Test Matrix ​

Maintained Linux E2E tests run on GitHub Actions Ubuntu 22.04+ environments with root privileges and kernel version 4.18+ (or 5.5+ for ARM64) test/e2e/linux/common.sh:30-63.

Sources: test/e2e/linux/common.sh:30-207, test/e2e/lib/testlib.sh:1-211, test/e2e/linux/tls_test.sh:81-158


6.2.4 Android E2E Harness and Conscrypt Validation ​

Android E2E testing targets API 33+ (Android 13 through 16) on rooted devices or emulators utilizing platform Conscrypt/BoringSSL (test/e2e/android/common_android.sh:72-155).

Sources: test/e2e/android/android_tls_e2e_test.sh:19-154, test/e2e/android/common_android.sh:65-155


6.2.5 Output Mode Verification (Text, Keylog, and pcapng) ​

The E2E test suite validates artifact integrity for all three capture modes:

  • Text Mode: Asserts that plaintext tokens matching the E2E test run appear in the event stream without leaking into operational logs test/e2e/linux/tls_test.sh:81-99.
  • Keylog Mode: Captures raw packets via tshark concurrently while eCapture writes NSS keylog files. It verifies the presence of TLS 1.2 CLIENT_RANDOM and TLS 1.3 traffic secrets, then uses tshark with -o tls.keylog_file to successfully decrypt the packet capture test/e2e/linux/tls_test.sh:101-137, test/e2e/lib/testlib.sh:185-205.
  • pcapng Mode: Validates generated pcapng artifacts against structural requirements using pcapng_check, ensuring the presence of Section Header Blocks (SHB), Interface Description Blocks (IDB), Enhanced Packet Blocks, and TLS Decryption Secrets Blocks (DSB) test/e2e/README.md:41-47, test/e2e/linux/tls_test.sh:139-158.

Sources: test/e2e/README.md:30-58, test/e2e/linux/tls_test.sh:81-158, test/e2e/lib/testlib.sh:185-211

TLS Test and E2E Strategy has loaded
Download