Exemple #1
0
func setUpDocker(c *check.C) {
	common.InstallSnap(c, "docker/edge")
	dockerVersion := common.GetCurrentVersion(c, "docker")
	dockerService := fmt.Sprintf("docker_docker-daemon_%s.service", dockerVersion)

	err := wait.ForActiveService(c, dockerService)
	c.Assert(err, check.IsNil, check.Commentf("Error waiting for service: %s", err))

	err = wait.ForCommand(c, `(?ms).*docker\.sock\s.*`, "ls", "/run")
	c.Assert(err, check.IsNil, check.Commentf("Expected nil error, got %s", err))

	cli.ExecCommand(c, "docker", "pull", baseContainer)
}
Exemple #2
0
func restartDocker(c *check.C) {
	dockerVersion := common.GetCurrentVersion(c, "docker")
	dockerService := fmt.Sprintf("docker_docker-daemon_%s.service", dockerVersion)

	cli.ExecCommand(c, "sudo", "systemctl", "restart", dockerService)

	// we need to wait until the socket is ready, an active systemctl status is not enough
	err := wait.ForActiveService(c, dockerService)
	c.Assert(err, check.IsNil, check.Commentf("Expected nil error, got %s", err))

	err = wait.ForCommand(c, `(?ms).*docker\.sock\s.*`, "ls", "/run")
	c.Assert(err, check.IsNil, check.Commentf("Expected nil error, got %s", err))
}
Exemple #3
0
func (s *snapdTestSuite) SetUpTest(c *check.C) {
	s.SnappySuite.SetUpTest(c)

	trustedKey, err := filepath.Abs("integration-tests/data/trusted.acckey")
	c.Assert(err, check.IsNil)

	cli.ExecCommand(c, "sudo", "systemctl", "stop",
		"ubuntu-snappy.snapd.service", "ubuntu-snappy.snapd.socket")

	// FIXME: for now pass a test-only trusted key through an env var
	s.cmd = exec.Command("sudo", "env", "PATH="+os.Getenv("PATH"),
		"SNAPPY_TRUSTED_ACCOUNT_KEY="+trustedKey,
		"/lib/systemd/systemd-activate", "-ESNAPPY_TRUSTED_ACCOUNT_KEY",
		"-l", "/run/snapd.socket", "snapd")

	s.cmd.Start()

	wait.ForCommand(c, `^$`, "sudo", "chmod", "0666", "/run/snapd.socket")
	common.InstallSnap(c, httpClientSnap+"/edge")
}