summaryrefslogtreecommitdiff
path: root/test/compose/test-compose
diff options
context:
space:
mode:
Diffstat (limited to 'test/compose/test-compose')
-rwxr-xr-xtest/compose/test-compose32
1 files changed, 26 insertions, 6 deletions
diff --git a/test/compose/test-compose b/test/compose/test-compose
index 704c71a9f..46ca80321 100755
--- a/test/compose/test-compose
+++ b/test/compose/test-compose
@@ -136,8 +136,11 @@ function _show_ok() {
local expect=$3
local actual=$4
printf "${red}not ok $count $testname${reset}\n"
- printf "${red}# expected: %s${reset}\n" "$expect"
- printf "${red}# actual: ${bold}%s${reset}\n" "$actual"
+ # Not all errors include actual/expect
+ if [[ -n "$expect" || -n "$actual" ]]; then
+ printf "${red}# expected: %s${reset}\n" "$expect"
+ printf "${red}# actual: ${bold}%s${reset}\n" "$actual"
+ fi
echo "not ok $count $testname" >>$LOG
echo " expected: $expect" >>$LOG
@@ -163,12 +166,24 @@ function test_port() {
local op="$2" # '=' or '~'
local expect="$3" # what to expect from curl output
- local actual=$(curl --retry 10 --retry-all-errors -s http://127.0.0.1:$port/)
+ # -s -S means "silent, but show errors"
+ local actual
+ actual=$(curl --retry 3 --retry-all-errors -s -S http://127.0.0.1:$port/)
local curl_rc=$?
+
if [ $curl_rc -ne 0 ]; then
- _show_ok 0 "$testname - curl failed with status $curl_rc"
-### docker-compose down >>$logfile 2>&1
-### exit 1
+ _show_ok 0 "$testname - curl (port $port) failed with status $curl_rc"
+ echo "# podman ps -a:"
+ $PODMAN_BIN --root $WORKDIR/root --runroot $WORKDIR/runroot ps -a
+ if type -p ss; then
+ echo "# ss -tulpn:"
+ ss -tulpn
+ echo "# podman unshare --rootless-cni ss -tulpn:"
+ $PODMAN_BIN --root $WORKDIR/root --runroot $WORKDIR/runroot unshare --rootless-cni ss -tulpn
+ fi
+ echo "# cat $WORKDIR/server.log:"
+ cat $WORKDIR/server.log
+ return
fi
case "$op" in
@@ -198,6 +213,7 @@ function start_service() {
cp /etc/cni/net.d/*podman*conflist $WORKDIR/cni/
$PODMAN_BIN \
+ --log-level debug \
--root $WORKDIR/root \
--runroot $WORKDIR/runroot \
--cgroup-manager=systemd \
@@ -279,6 +295,10 @@ fi
# Too hard to precompute the number of tests; just spit it out at the end.
n_tests=0
+
+# We aren't really TAP 13; this helps logformatter recognize our output as BATS
+echo "TAP version 13"
+
for t in ${tests_to_run[@]}; do
testdir="$(dirname $t)"
testname="$(basename $testdir)"