diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-02-05 14:52:03 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-02-05 15:35:50 +0100 |
commit | 80b75d299e68db0efb027adf389160a091cca4ba (patch) | |
tree | b0433acaeaffaee7275bef486a57497b33d49697 /test/e2e/common_test.go | |
parent | b1d4dbd335f4801487ef86964b6833c3604ceef5 (diff) | |
download | podman-80b75d299e68db0efb027adf389160a091cca4ba.tar.gz podman-80b75d299e68db0efb027adf389160a091cca4ba.tar.bz2 podman-80b75d299e68db0efb027adf389160a091cca4ba.zip |
tests: allow to override the OCI runtime
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test/e2e/common_test.go')
-rw-r--r-- | test/e2e/common_test.go | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 308a6bf29..b22ead3fa 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -34,7 +34,7 @@ type PodmanTestIntegration struct { ConmonBinary string CrioRoot string CNIConfigDir string - RunCBinary string + OCIRuntime string RunRoot string StorageOptions string SignaturePolicyPath string @@ -136,12 +136,16 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration { cgroupManager = "cgroupfs" } - runCBinary, err := exec.LookPath("runc") - // If we cannot find the runc binary, setting to something static as we have no way - // to return an error. The tests will fail and point out that the runc binary could - // not be found nicely. - if err != nil { - runCBinary = "/usr/bin/runc" + ociRuntime := os.Getenv("OCI_RUNTIME") + if ociRuntime == "" { + var err error + ociRuntime, err = exec.LookPath("runc") + // If we cannot find the runc binary, setting to something static as we have no way + // to return an error. The tests will fail and point out that the runc binary could + // not be found nicely. + if err != nil { + ociRuntime = "/usr/bin/runc" + } } CNIConfigDir := "/etc/cni/net.d" @@ -156,7 +160,7 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration { ConmonBinary: conmonBinary, CrioRoot: filepath.Join(tempDir, "crio"), CNIConfigDir: CNIConfigDir, - RunCBinary: runCBinary, + OCIRuntime: ociRuntime, RunRoot: filepath.Join(tempDir, "crio-run"), StorageOptions: storageOptions, SignaturePolicyPath: filepath.Join(INTEGRATION_ROOT, "test/policy.json"), |