Files
moby/integration-cli
Paweł Gronowski 883fa289e4 integration: Migrate flaky TestBuildNetContainer from integration-cli
TestBuildNetContainer failed with an empty /otherhost instead of the
expected "foobar" hostname on CI hosts with newer AppArmor policy.

The listener ran "nc -ll -p 1234 -e hostname".
With the stacked docker-default//&unconfined confinement seen in CI,
exec'ing /bin/hostname attached the host's "hostname" AppArmor profile,
which denied writing to the inherited socket:

```
apparmor="DENIED" operation="file_inherit" class="net" info="failed type match" error=-13 profile="hostname" comm="hostname" ... requested="send receive" denied="send receive"
```

The client then saw EOF and exited successfully with no output.

Move the test to integration/build as TestBuildNetworkModeContainer and
reply with shell builtins ("echo $HOSTNAME") so no binary named
hostname is exec'd.
Also wait until the listener answers with the expected hostname before
starting the build, instead of relying on a single connection attempt.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-11-05 21:25:17 +01:00
..
2025-09-08 10:08:30 +02:00
2025-12-15 18:56:34 +01:00
2025-06-05 21:42:05 +00:00
2025-06-05 21:42:05 +00:00