mirror of
https://github.com/containers/podman.git
synced 2025-06-27 21:50:18 +08:00
Add ability for ubuntu to be tested
unfortunately the papr CI system cannot test ubuntu as a VM; therefore, this PR still keeps travis. but it does include fixes that will be required for running on modern versions of ubuntu. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -63,6 +63,7 @@ type PodmanTest struct {
|
||||
ArtifactPath string
|
||||
TempDir string
|
||||
CgroupManager string
|
||||
Host HostOS
|
||||
}
|
||||
|
||||
// HostOS is a simple struct for the test os
|
||||
@ -126,6 +127,7 @@ func CreateTempDirInTempDir() (string, error) {
|
||||
// PodmanCreate creates a PodmanTest instance for the tests
|
||||
func PodmanCreate(tempDir string) PodmanTest {
|
||||
|
||||
host := GetHostDistributionInfo()
|
||||
cwd, _ := os.Getwd()
|
||||
|
||||
podmanBinary := filepath.Join(cwd, "../../bin/podman")
|
||||
@ -149,7 +151,19 @@ func PodmanCreate(tempDir string) PodmanTest {
|
||||
cgroupManager = os.Getenv("CGROUP_MANAGER")
|
||||
}
|
||||
|
||||
runCBinary := "/usr/bin/runc"
|
||||
// Ubuntu doesn't use systemd cgroups
|
||||
if host.Distribution == "ubuntu" {
|
||||
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"
|
||||
}
|
||||
|
||||
CNIConfigDir := "/etc/cni/net.d"
|
||||
|
||||
p := PodmanTest{
|
||||
@ -164,6 +178,7 @@ func PodmanCreate(tempDir string) PodmanTest {
|
||||
ArtifactPath: ARTIFACT_DIR,
|
||||
TempDir: tempDir,
|
||||
CgroupManager: cgroupManager,
|
||||
Host: host,
|
||||
}
|
||||
|
||||
// Setup registries.conf ENV variable
|
||||
|
Reference in New Issue
Block a user