diff options
-rwxr-xr-x | contrib/cirrus/setup_environment.sh | 2 | ||||
-rw-r--r-- | libpod/healthcheck_linux.go | 11 | ||||
-rw-r--r-- | test/e2e/checkpoint_test.go | 10 |
3 files changed, 17 insertions, 6 deletions
diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh index 2f9b1d796..98276b70c 100755 --- a/contrib/cirrus/setup_environment.sh +++ b/contrib/cirrus/setup_environment.sh @@ -55,6 +55,8 @@ then CON_SEL="https://kojipkgs.fedoraproject.org/packages/container-selinux/2.100/1.git3b78187.fc29/noarch/container-selinux-2.100-1.git3b78187.fc29.noarch.rpm" echo ">>>>> OVERRIDING container-selinux WITH $CON_SEL <<<<<" dnf -y install $CON_SEL + echo ">>>>> OVERRIDING criu and selinux-policy with latest package <<<<<" + dnf -y upgrade criu selinux-policy ;& # Continue to the next item fedora-28) echo ">>>>> OVERRIDING source-built runc with latest package <<<<<" diff --git a/libpod/healthcheck_linux.go b/libpod/healthcheck_linux.go index 869605ea8..d47a3b7cd 100644 --- a/libpod/healthcheck_linux.go +++ b/libpod/healthcheck_linux.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "os/exec" + "strings" "github.com/coreos/go-systemd/dbus" "github.com/pkg/errors" @@ -61,7 +62,13 @@ func (c *Container) removeTimer() error { return errors.Wrapf(err, "unable to get systemd connection to remove healthchecks") } defer conn.Close() - serviceFile := fmt.Sprintf("%s.timer", c.ID()) - _, err = conn.StopUnit(serviceFile, "fail", nil) + timerFile := fmt.Sprintf("%s.timer", c.ID()) + _, err = conn.StopUnit(timerFile, "fail", nil) + + // We want to ignore errors where the timer unit has already been removed. The error + // return is generic so we have to check against the string in the error + if err != nil && strings.HasSuffix(err.Error(), ".timer not loaded.") { + return nil + } return err } diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go index 5b549755e..c2f5a592c 100644 --- a/test/e2e/checkpoint_test.go +++ b/test/e2e/checkpoint_test.go @@ -21,6 +21,7 @@ var _ = Describe("Podman checkpoint", func() { ) BeforeEach(func() { + SkipIfRootless() tempdir, err = CreateTempDirInTempDir() if err != nil { os.Exit(1) @@ -41,11 +42,12 @@ var _ = Describe("Podman checkpoint", func() { if !criu.CheckForCriu() { Skip("CRIU is missing or too old.") } - // TODO: Remove the skip when the current CRIU SELinux problem is solved. - // See: https://github.com/containers/libpod/issues/2334 + // Only Fedora 29 and newer has a new enough selinux-policy and + // container-selinux package to support CRIU in correctly + // restoring threaded processes hostInfo := podmanTest.Host - if hostInfo.Distribution == "fedora" { - Skip("Checkpointing containers on Fedora currently broken.") + if hostInfo.Distribution == "fedora" && hostInfo.Version < "29" { + Skip("Checkpoint/Restore with SELinux only works on Fedora >= 29") } }) |