spiegel_podman/test
baude a6de23278a Use REGISTRIES_CONFIG_PATH for all tests
We should not be using the test systems registries.conf file for integration
tests. We should always use a constructed file created specifically for the
integration tests or we stand to have unpredictable results.  The beforeTest
function now sets an environment variable pointing to a registries.conf file
in the test's tempdir.  That file will container docker.io as a default.

The afterTest function then clears the environment variable.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1197
Approved by: rhatdan
2018-08-02 12:40:14 +00:00
..
bin2img Vendor in latest containers/image and contaners/storage 2018-04-19 14:08:47 +00:00
build Initial podman build 2017-12-23 11:47:33 +00:00
certs Add several podman push tests 2018-04-16 10:55:11 +08:00
checkseccomp Don't pollute the build output with failures to build checkseccomp 2018-07-26 20:47:31 +00:00
copyimg Vendor in latest containers/image and contaners/storage 2018-04-19 14:08:47 +00:00
e2e Use REGISTRIES_CONFIG_PATH for all tests 2018-08-02 12:40:14 +00:00
policy.json Initial checkin from CRI-O repo 2017-11-01 11:24:59 -04:00
README.md Add pointers for Integration Tests to docs 2018-06-06 18:45:57 +00:00
redhat_sigstore.yaml Initial checkin from CRI-O repo 2017-11-01 11:24:59 -04:00
registries.conf Use REGISTRIES_CONFIG_PATH for all tests 2018-08-02 12:40:14 +00:00
test_podman_baseline.sh Add OnBuild and usernamespace test to baseline 2018-07-23 12:38:17 +00:00
test_podman_build.sh Initial podman build 2017-12-23 11:47:33 +00:00

PODMAN logo

Integration Tests

Our primary means of performing integration testing for libpod is with the Ginkgo BDD testing framework. This allows us to use native Golang to perform our tests and there is a strong affiliation between Ginkgo and the Go test framework.

Installing dependencies

The dependencies for integration really consists of three things:

  • ginkgo binary
  • ginkgo sources
  • gomega sources

The following instructions assume your GOPATH is ~/go. Adjust as needed for your environment.

Installing ginkgo

Fetch and build ginkgo with the following command:

GOPATH=~/go go get -u github.com/onsi/ginkgo/ginkgo

Now install the ginkgo binary into your path:

install -D -m 755 "$GOPATH"/bin/ginkgo /usr/bin/

You now have a ginkgo binary and its sources in your GOPATH.

Install gomega sources

The gomega sources can be simply installed with the command:

GOPATH=~/go go get github.com/onsi/gomega/...

Running the integration tests

You can run the entire suite of integration tests with the following command:

GOPATH=~/go ginkgo -v test/e2e/.

Note the trailing period on the command above. Also, -v invokes verbose mode. That switch is optional.

You can run a single file of integration tests using the go test command:

GOPATH=~/go go test -v test/e2e/libpod_suite_test.go test/e2e/your_test.go

Run all tests like PAPR

You can closely emulate the PAPR run for Fedora with the following command:

make integration.fedora

This will run lint, git-validation, and gofmt tests and then execute unit and integration tests as well.

Run tests in a container

In case you have issue running the tests locally on your machine, you can run them in a container:

make shell

This will run a container and give you a shell and you can follow the instructions above.