# snouty validate — failure cases with container runtime

# Unknown prefix file — validate errors.
build-image unknown-prefix-failures:latest unknown_prefix
! snouty validate config_unknown --timeout 15
stderr 'unrecognized command names.*'
stderr 'suite/readme.txt.*'

# Non-executable script — validate detects missing executable bit.
build-image noexec-failures:latest noexec
! snouty validate config_noexec --timeout 15
stderr 'not executable.*'
stderr 'suite/first_noexec.*'

-- unknown_prefix/suite/first_ok --
#!/bin/sh
echo "first_ok ran"

-- unknown_prefix/suite/readme.txt --
This is not a script.

-- unknown_prefix/Dockerfile --
FROM busybox
COPY suite/ /opt/antithesis/test/v1/suite/
RUN chmod +x /opt/antithesis/test/v1/suite/first_ok
CMD sh -c 'echo "{\"antithesis_setup\":{\"status\":\"complete\"}}" >> "$ANTITHESIS_OUTPUT_DIR/sdk.jsonl" && sleep 3600'
-- config_unknown/docker-compose.yaml --
services:
  runner:
    image: unknown-prefix-failures:latest
    pull_policy: never

-- noexec/suite/first_noexec --
#!/bin/sh
echo "should not run"

-- noexec/suite/parallel_driver_load --
#!/bin/sh
echo "driver ran"

-- noexec/Dockerfile --
FROM busybox
COPY suite/ /opt/antithesis/test/v1/suite/
RUN chmod +x /opt/antithesis/test/v1/suite/parallel_driver_load
CMD sh -c 'echo "{\"antithesis_setup\":{\"status\":\"complete\"}}" >> "$ANTITHESIS_OUTPUT_DIR/sdk.jsonl" && sleep 3600'
-- config_noexec/docker-compose.yaml --
services:
  runner:
    image: noexec-failures:latest
    pull_policy: never
