nerdexam
Cisco

350-901 · Question #67

A container running a Python script is failing when it reaches the integration testing phase of the CI/CD process. The code has been reviewed thoroughly and the build process works on this container…

The correct answer is A. that the correct port is exposed in the Dockerfile. When a container passes unit tests but fails integration tests due to connectivity issues, the Dockerfile must be verified to ensure the required port is exposed for inter-service communication.

Application Deployment and Security

Question

A container running a Python script is failing when it reaches the integration testing phase of the CI/CD process. The code has been reviewed thoroughly and the build process works on this container and all other containers pass unit and integration testing. What should be verified to resolve the issue?

Options

  • Athat the correct port is exposed in the Dockerfile
  • Bthat the necessary modules and packages are installed on build
  • Cthat the script is running from the night directory
  • Dthat the Python version of the container image is correct

How the community answered

(19 responses)
  • A
    79% (15)
  • B
    5% (1)
  • C
    11% (2)
  • D
    5% (1)

Why each option

When a container passes unit tests but fails integration tests due to connectivity issues, the Dockerfile must be verified to ensure the required port is exposed for inter-service communication.

Athat the correct port is exposed in the DockerfileCorrect

Integration testing requires the container to accept inbound network connections from other services or test harnesses; if the EXPOSE directive in the Dockerfile is missing or specifies the wrong port, external processes cannot reach the Python script's listening service, causing integration failures while unit tests - which run in isolation - still pass.

Bthat the necessary modules and packages are installed on build

If necessary modules were missing, the build process itself would fail or the unit tests would also fail, but the question states the build works and unit tests pass.

Cthat the script is running from the night directory

An incorrect working directory would cause failures at startup or during all test phases, not specifically at integration testing while unit tests pass.

Dthat the Python version of the container image is correct

An incorrect Python version would cause syntax or compatibility errors visible during build or unit testing, not selectively during integration testing.

Concept tested: Dockerfile EXPOSE directive for container integration testing

Source: https://docs.docker.com/reference/dockerfile/#expose

Topics

#Containerization#CI/CD#Docker Networking#Integration Testing

Community Discussion

No community discussion yet for this question.

Full 350-901 Practice