mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
006d58d7e6
Also live restore is stable now. So move experimental tests out to stable. Signed-off-by: Anusha Ragunathan <anusha@docker.com>
54 lines
1.5 KiB
Go
54 lines
1.5 KiB
Go
// +build linux, experimental
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/docker/docker/pkg/integration/checker"
|
|
"github.com/go-check/check"
|
|
)
|
|
|
|
var pluginName = "tiborvass/no-remove"
|
|
|
|
// TestDaemonRestartWithPluginEnabled tests state restore for an enabled plugin
|
|
func (s *DockerDaemonSuite) TestDaemonRestartWithPluginEnabled(c *check.C) {
|
|
if err := s.d.Start(); err != nil {
|
|
c.Fatalf("Could not start daemon: %v", err)
|
|
}
|
|
|
|
if out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pluginName); err != nil {
|
|
c.Fatalf("Could not install plugin: %v %s", err, out)
|
|
}
|
|
|
|
if err := s.d.Restart(); err != nil {
|
|
c.Fatalf("Could not restart daemon: %v", err)
|
|
}
|
|
|
|
out, err := s.d.Cmd("plugin", "ls")
|
|
if err != nil {
|
|
c.Fatalf("Could not list plugins: %v %s", err, out)
|
|
}
|
|
c.Assert(out, checker.Contains, pluginName)
|
|
c.Assert(out, checker.Contains, "true")
|
|
}
|
|
|
|
// TestDaemonRestartWithPluginEnabled tests state restore for a disabled plugin
|
|
func (s *DockerDaemonSuite) TestDaemonRestartWithPluginDisabled(c *check.C) {
|
|
if err := s.d.Start(); err != nil {
|
|
c.Fatalf("Could not start daemon: %v", err)
|
|
}
|
|
|
|
if out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pluginName, "--disable"); err != nil {
|
|
c.Fatalf("Could not install plugin: %v %s", err, out)
|
|
}
|
|
|
|
if err := s.d.Restart(); err != nil {
|
|
c.Fatalf("Could not restart daemon: %v", err)
|
|
}
|
|
|
|
out, err := s.d.Cmd("plugin", "ls")
|
|
if err != nil {
|
|
c.Fatalf("Could not list plugins: %v %s", err, out)
|
|
}
|
|
c.Assert(out, checker.Contains, pluginName)
|
|
c.Assert(out, checker.Contains, "false")
|
|
}
|