Skip to content

Commit 632e4eb

Browse files
author
wildleo91
committed
ci(integration-tests): diagnostic step round 2 — tar probe first, set +e
Round 1 (91772ad) had `set -e` inherited from `bash -e {0}` shell invocation. The diagnostic script halted at the first failing probe (`head -c 50` on a mode-600 file), so the actual tar probe — the operation that docker cp uses internally and is the proximate cause of fixture teardown failures — never ran. QA SubAgent caught the gap before I committed a fix on incomplete evidence (the "setfacl will work" hypothesis was extrapolated from "file is mode 600 + runner can't read" without measuring that tar actually fails the same way). Changes in round 2: - `set +e` at the top so each probe runs independently - Tar probe MOVED TO PROBE 1 (highest diagnostic value, runs even if downstream probes fail) - Added `getfacl` + `mount` to confirm filesystem supports ACLs - Added `which setfacl` to confirm the tool is installed - `exit 0` at end so this step never gates downstream steps Goal: this single CI run produces enough evidence to either (a) confirm tar-fails-on-mode-600 hypothesis, in which case setfacl with default-inheritance is the right fix, OR (b) reveal a different mechanism entirely. No prediction. The next commit waits on data.
1 parent 91772ad commit 632e4eb

1 file changed

Lines changed: 45 additions & 29 deletions

File tree

.github/workflows/integration-tests.yml

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -100,43 +100,59 @@ jobs:
100100

101101
- name: DIAGNOSTIC — permission/ownership state right before pytest
102102
# Added 2026-05-14 to break a 4-deep hypothesis loop on the
103-
# "220 teardown errors" failure mode. Captures the EXACT
104-
# state pytest sees at the moment the fixture's docker cp
105-
# starts failing with `tar: permission denied`. Compare host
106-
# vs container views; compare what runner sees vs what
107-
# splunk sees. Remove this step once the root cause is
108-
# identified and fixed.
103+
# "220 teardown errors" failure mode. Round 2 — reordered so
104+
# the tar probe runs FIRST (most diagnostic value), and
105+
# explicit `set +e` so failures in any single probe do not
106+
# halt the rest. Round 1 (91772ad) hit `set -e` (inherited
107+
# from `bash -e {0}`) at the `head -c 50` line which exited
108+
# before tar could run.
109109
if: always()
110110
run: |
111-
set -x
112-
echo "=== HOST ==="
111+
set +e # disable errexit — let every probe run regardless
112+
set -x # trace each command
113+
echo "=== PROBE 1 — does tar (what docker cp uses) fail? ==="
114+
# This is the single most important probe. If tar
115+
# succeeds, the mode-600 files are NOT what blocks
116+
# docker cp; the bug is elsewhere. If tar fails with
117+
# permission denied, we have direct evidence.
118+
tar czf /tmp/host_tar_probe.tgz -C lookups DR130_priv_escalation.csv DR20_whitelist.csv DR45_whitelist_hosts.csv 2>&1
119+
echo "PROBE-1 tar exit: $?"
120+
ls -la /tmp/host_tar_probe.tgz 2>&1 | head -1
121+
echo
122+
echo "=== PROBE 2 — full lookups tar (what _restore_canonical_demo_state does) ==="
123+
tar czf /tmp/host_full.tgz lookups/ 2>&1 | head -10
124+
echo "PROBE-2 full tar exit: $?"
125+
ls -la /tmp/host_full.tgz 2>&1 | head -1
126+
echo
127+
echo "=== HOST CONTEXT ==="
113128
id
114129
uname -a
115130
umask
116-
echo "--- host: ls -la lookups/ (first 12) ---"
117-
ls -la lookups/ | head -12
118-
echo "--- host: stat one specific failing file ---"
119-
stat lookups/DR130_priv_escalation.csv || true
120-
echo "--- host: can the runner cat that file? ---"
121-
head -c 50 lookups/DR130_priv_escalation.csv; echo
122-
echo "--- host: try tar (the operation that fails) ---"
123-
tar -czf /tmp/host_probe.tgz lookups/ 2>&1 | head -10 || true
124-
ls -la /tmp/host_probe.tgz 2>&1 | head -1 || true
131+
echo "--- host: ls -la lookups/ (first 14) ---"
132+
ls -la lookups/ | head -14
133+
echo "--- host: stat one mode-600 file ---"
134+
stat lookups/DR130_priv_escalation.csv 2>&1
135+
echo "--- host: can runner read mode-644 file? ---"
136+
head -c 50 lookups/DR102_whitelist.csv 2>&1; echo
137+
echo "--- host: can runner read mode-600 file? ---"
138+
head -c 50 lookups/DR130_priv_escalation.csv 2>&1; echo
125139
echo "=== DOCKER ENGINE ==="
126140
docker version --format 'Server: {{.Server.Version}}' 2>&1
127-
docker info 2>&1 | grep -iE "Docker Root Dir|userns|rootless|Storage Driver|Cgroup" | head -10
128-
echo "=== CONTAINER (as root) ==="
129-
docker exec -u 0 wl_manager_test id splunk 2>&1
130-
docker exec -u 0 wl_manager_test ls -la /opt/splunk/etc/apps/wl_manager/lookups/ 2>&1 | head -12
131-
docker exec -u 0 wl_manager_test stat /opt/splunk/etc/apps/wl_manager/lookups/DR130_priv_escalation.csv 2>&1 || true
141+
docker info 2>&1 | grep -iE "Docker Root Dir|userns|rootless|Storage Driver|Cgroup Driver" | head -10
142+
echo "=== FILESYSTEM SUPPORTS ACL? ==="
143+
mount | grep -E "$(pwd|head -c 20)" | head -3
144+
which setfacl 2>&1
145+
getfacl lookups/DR130_priv_escalation.csv 2>&1 | head -10
132146
echo "=== CONTAINER (as splunk) ==="
133-
docker exec wl_manager_test whoami 2>&1
134-
docker exec wl_manager_test ls -la /opt/splunk/etc/apps/wl_manager/lookups/ 2>&1 | head -12
135-
docker exec wl_manager_test cat /opt/splunk/etc/apps/wl_manager/lookups/DR130_priv_escalation.csv 2>&1 | head -c 50 || true
136-
echo
137-
echo "=== DOCKER CP DRY-RUN (the operation that fails inside the fixture) ==="
138-
docker cp lookups/. wl_manager_test:/tmp/probe_lookups/ 2>&1 | head -10 || true
139-
docker exec -u 0 wl_manager_test ls -la /tmp/probe_lookups/ 2>&1 | head -5 || true
147+
docker exec wl_manager_test id 2>&1
148+
docker exec wl_manager_test ls -la /opt/splunk/etc/apps/wl_manager/lookups/ 2>&1 | head -14
149+
docker exec wl_manager_test head -c 50 /opt/splunk/etc/apps/wl_manager/lookups/DR130_priv_escalation.csv 2>&1; echo
150+
echo "=== DOCKER CP DRY-RUN ==="
151+
docker cp lookups/. wl_manager_test:/tmp/probe_lookups/ 2>&1 | head -10
152+
echo "PROBE docker cp exit: $?"
153+
docker exec -u 0 wl_manager_test ls -la /tmp/probe_lookups/ 2>&1 | head -8
154+
# Always exit 0 — this step is diagnostic only, never a gate
155+
exit 0
140156
141157
- name: Run integration suite
142158
# The session-level _restore_canonical_demo_state fixture

0 commit comments

Comments
 (0)