func restartDockerHost(node utils.TestbedNode) error { log.Infof("Restarting docker on %q", node.GetName()) // note that for all these restart tasks we error out quietly to avoid other // hosts being cleaned up node.RunCommand("sudo service docker restart") return nil }
// DockerCleanupWithEnv kills and removes a container on a specified testbed node // and with specified env-variables func DockerCleanupWithEnv(t *testing.T, node stu.TestbedNode, contName string, env []string) { if !OkToCleanup(t.Failed()) { return } cmdStr := fmt.Sprintf("sudo %s docker kill %s", strings.Join(env, " "), contName) node.RunCommand(cmdStr) cmdStr = fmt.Sprintf("sudo %s docker rm %s", strings.Join(env, " "), contName) node.RunCommand(cmdStr) }
func (s *systemtestSuite) clearVolumeHost(node utils.TestbedNode) error { log.Infof("Clearing volumes on %q", node.GetName()) node.RunCommand("docker volume ls | tail -n +2 | awk '{ print $2 }' | xargs docker volume rm") return nil }
func (s *systemtestSuite) clearContainerHost(node utils.TestbedNode) error { log.Infof("Clearing containers on %q", node.GetName()) node.RunCommand("docker ps -aq | xargs docker rm -f") return nil }
func stopVolplugin(node utils.TestbedNode) error { log.Infof("Stopping the volplugin on %q", node.GetName()) return node.RunCommand("sudo pkill volplugin") }
func stopVolmaster(node utils.TestbedNode) error { log.Infof("Stopping the volmaster on %s", node.GetName()) return node.RunCommand("sudo pkill volmaster") }
func (s *systemtestSuite) volpluginStop(node utils.TestbedNode) error { log.Infof("Stopping the volplugin on %q", node.GetName()) return node.RunCommand("sudo pkill volplugin") }
// StopNetmaster stops the netmaster on specified testbed node func StopNetmaster(t *testing.T, node stu.TestbedNode) { cmdStr := "sudo pkill netmaster" node.RunCommand(cmdStr) }
func volpluginStop(node utils.TestbedNode) error { return node.RunCommand("sudo pkill volplugin") }