Google has announced a new framework designed to help developers conduct unit tests on Docker container images.
The Container Structure Test gives enterprises a way to verify the structure and contents of individual containers to ensure that everything is as it should be before shipping to production, the company said in the company’s Open Source blog Jan. 9.
Google has been using the framework to test containers internally for more than a year and has released it publicly because it offers an easier way to validate the structure of Docker containers than other approaches, the company said.
“The Docker toolchain provides us with easy ways to interact with the container images themselves, but no real way of verifying their contents, said Nick Kubala, a member of Google’s container team in the blog.
“What if we want to ensure a set of commands runs successfully inside of our container, or check that certain files are in the correct place with the correct contents, before shipping?”
Google’s Container Structure Test framework supports four different types of unit level tests for Docker containers, command tests, file existence tests, file content tests and metadata tests.
Command tests allow administrators to execute a specific command inside a container image and verify if the output matches what is expected, or is an error. Administrators can use the file existence test to check for the existence of expected files in a container image and the file content tests to verify the metadata and contents in the container file system.
The metadata tests allow administrators to verify a Docker image’s metadata and its configuration and making sure that it matches specifications.
The new test framework reflects Google’s broader commitment to make things easier for organizations to deploy and manage containers on its cloud platform. Google, like other major cloud vendors such as Amazon Web Services and Microsoft Azure offers a broad and growing range of services to help companies test, deploy and manage containerized applications in the cloud.
One of Google’s most notable offerings in this space is Kubernetes, a container cluster management technology that the company released to the open source community about three years ago.
Google Container Builder is another example. Released last year, the technology lets developers pack early builds of their software programs into Docker containers on Google Cloud. The company has billed Container Builder as a tool that can help enterprise development teams improve their software release process.
Last May, Google introduced a new feature called node pools in Container Engine that allows administrators to set up and manage container cluster, each one running machines with different configurations.
In the past 12 months, Google has also moved its Container Optimized OS from limited testing to general availability, released an updated version of Kubernetes and added new automated capabilities for managing container nodes.