Merge pull request #276 from vdemeester/mini-kermit-update

A small update of libkermit
This commit is contained in:
Emile Vauge 2016-04-02 13:26:16 +02:00
commit 6e7bb93fd6
11 changed files with 78 additions and 72 deletions

44
glide.lock generated
View file

@ -1,5 +1,5 @@
hash: a8cca3f2e5bde6b96d0c195402b14606877bc8630cd7f2f06e65e0884c6a008b hash: 7ae4c083b2f2754acc858a7e2cd453343966dc62eef01fbd51adf8c718959a0c
updated: 2016-03-29T23:24:08.772606184+02:00 updated: 2016-04-02T12:38:43.346296635+02:00
imports: imports:
- name: github.com/alecthomas/template - name: github.com/alecthomas/template
version: b867cc6ab45cece8143cfcc6fc9c77cf3f2c23c0 version: b867cc6ab45cece8143cfcc6fc9c77cf3f2c23c0
@ -39,7 +39,9 @@ imports:
subpackages: subpackages:
- spew - spew
- name: github.com/docker/distribution - name: github.com/docker/distribution
version: 9038e48c3b982f8e82281ea486f078a73731ac4e version: ff6f38ccb69afa96214c7ee955359465d1fc767a
subpackages:
- reference
- name: github.com/docker/docker - name: github.com/docker/docker
version: f39987afe8d611407887b3094c03d6ba6a766a67 version: f39987afe8d611407887b3094c03d6ba6a766a67
subpackages: subpackages:
@ -79,14 +81,22 @@ imports:
- runconfig - runconfig
- utils - utils
- volume - volume
- name: github.com/docker/engine-api
version: 8924d6900370b4c7e7984be5adc61f50a80d7537
subpackages:
- client
- types
- types/container
- types/filters
- types/strslice
- name: github.com/docker/go-connections
version: f549a9393d05688dff0992ef3efd8bbe6c628aeb
subpackages:
- nat
- name: github.com/docker/go-units
version: 5d2041e26a699eaca682e2ea41c8f891e1060444
- name: github.com/docker/libcompose - name: github.com/docker/libcompose
version: e290a513ba909ca3afefd5cd611f3a3fe56f6a3a version: e290a513ba909ca3afefd5cd611f3a3fe56f6a3a
subpackages:
- docker
- logger
- lookup
- project
- utils
- name: github.com/docker/libkv - name: github.com/docker/libkv
version: 3732f7ff1b56057c3158f10bceb1e79133025373 version: 3732f7ff1b56057c3158f10bceb1e79133025373
subpackages: subpackages:
@ -115,16 +125,18 @@ imports:
- external/github.com/Sirupsen/logrus - external/github.com/Sirupsen/logrus
- external/github.com/docker/docker/pkg/idtools - external/github.com/docker/docker/pkg/idtools
- external/github.com/docker/docker/pkg/ioutils - external/github.com/docker/docker/pkg/ioutils
- external/github.com/docker/docker/pkg/longpath
- external/github.com/docker/docker/pkg/pools - external/github.com/docker/docker/pkg/pools
- external/github.com/docker/docker/pkg/promise - external/github.com/docker/docker/pkg/promise
- external/github.com/docker/docker/pkg/system - external/github.com/docker/docker/pkg/system
- external/github.com/docker/docker/pkg/longpath
- external/github.com/opencontainers/runc/libcontainer/user - external/github.com/opencontainers/runc/libcontainer/user
- external/golang.org/x/sys/unix - external/golang.org/x/sys/unix
- external/golang.org/x/net/context - external/golang.org/x/net/context
- external/github.com/docker/go-units - external/github.com/docker/go-units
- name: github.com/gambol99/go-marathon - name: github.com/gambol99/go-marathon
version: ade11d1dc2884ee1f387078fc28509559b6235d1 version: ade11d1dc2884ee1f387078fc28509559b6235d1
- name: github.com/go-check/check
version: 11d3bc7aa68e238947792f30573146a3231fc0f1
- name: github.com/golang/glog - name: github.com/golang/glog
version: fca8c8854093a154ff1eb580aae10276ad6b1b5f version: fca8c8854093a154ff1eb580aae10276ad6b1b5f
- name: github.com/google/go-querystring - name: github.com/google/go-querystring
@ -168,8 +180,6 @@ imports:
version: fada45142db3f93097ca917da107aa3fad0ffcb5 version: fada45142db3f93097ca917da107aa3fad0ffcb5
- name: github.com/mailgun/multibuf - name: github.com/mailgun/multibuf
version: 565402cd71fbd9c12aa7e295324ea357e970a61e version: 565402cd71fbd9c12aa7e295324ea357e970a61e
- name: github.com/mailgun/predicate
version: cb0bff91a7ab7cf7571e661ff883fc997bc554a3
- name: github.com/mailgun/timetools - name: github.com/mailgun/timetools
version: fd192d755b00c968d312d23f521eb0cdc6f66bd0 version: fd192d755b00c968d312d23f521eb0cdc6f66bd0
- name: github.com/miekg/dns - name: github.com/miekg/dns
@ -184,8 +194,6 @@ imports:
version: d8ed2627bdf02c080bf22230dbb337003b7aba2d version: d8ed2627bdf02c080bf22230dbb337003b7aba2d
subpackages: subpackages:
- difflib - difflib
- name: github.com/samalba/dockerclient
version: cfb489c624b635251a93e74e1e90eb0959c5367f
- name: github.com/samuel/go-zookeeper - name: github.com/samuel/go-zookeeper
version: fa6674abf3f4580b946a01bf7a1ce4ba8766205b version: fa6674abf3f4580b946a01bf7a1ce4ba8766205b
subpackages: subpackages:
@ -195,7 +203,7 @@ imports:
- name: github.com/spf13/cast - name: github.com/spf13/cast
version: ee7b3e0353166ab1f3a605294ac8cd2b77953778 version: ee7b3e0353166ab1f3a605294ac8cd2b77953778
- name: github.com/spf13/cobra - name: github.com/spf13/cobra
version: c678ff029ee250b65714e518f4f5c5cb934955de version: 2ccf9e982a3e3eb21eba9c9ad8e546529fd74c71
subpackages: subpackages:
- cobra - cobra
- name: github.com/spf13/jwalterweatherman - name: github.com/spf13/jwalterweatherman
@ -216,9 +224,9 @@ imports:
- name: github.com/unrolled/render - name: github.com/unrolled/render
version: 26b4e3aac686940fe29521545afad9966ddfc80c version: 26b4e3aac686940fe29521545afad9966ddfc80c
- name: github.com/vdemeester/libkermit - name: github.com/vdemeester/libkermit
version: 01a5399bdbd3312916c9fa4848108fbc81fe88d8 version: 9012902ed333111cf804fd5a28114d8a64002951
- name: github.com/vdemeester/shakers - name: github.com/vdemeester/shakers
version: 8fe734f75f3a70b651cbfbf8a55a009da09e8dc5 version: 24d7f1d6a71aa5d9cbe7390e4afb66b7eef9e1b3
- name: github.com/vulcand/oxy - name: github.com/vulcand/oxy
version: 8aaf36279137ac04ace3792a4f86098631b27d5a version: 8aaf36279137ac04ace3792a4f86098631b27d5a
subpackages: subpackages:
@ -255,8 +263,6 @@ imports:
- unix - unix
- name: gopkg.in/alecthomas/kingpin.v2 - name: gopkg.in/alecthomas/kingpin.v2
version: 639879d6110b1b0409410c7b737ef0bb18325038 version: 639879d6110b1b0409410c7b737ef0bb18325038
- name: gopkg.in/check.v1
version: 11d3bc7aa68e238947792f30573146a3231fc0f1
- name: gopkg.in/fsnotify.v1 - name: gopkg.in/fsnotify.v1
version: 96c060f6a6b7e0d6f75fddd10efeaca3e5d1bcb0 version: 96c060f6a6b7e0d6f75fddd10efeaca3e5d1bcb0
- name: gopkg.in/mgo.v2 - name: gopkg.in/mgo.v2

View file

@ -4,8 +4,6 @@ import:
ref: cc90c7b091275e606ad0ca7102a23fb2072f3f5e ref: cc90c7b091275e606ad0ca7102a23fb2072f3f5e
subpackages: subpackages:
- etcd - etcd
- package: github.com/docker/distribution
ref: 9038e48c3b982f8e82281ea486f078a73731ac4e
- package: github.com/mailgun/log - package: github.com/mailgun/log
ref: 44874009257d4d47ba9806f1b7f72a32a015e4d8 ref: 44874009257d4d47ba9806f1b7f72a32a015e4d8
- package: github.com/containous/oxy - package: github.com/containous/oxy
@ -26,7 +24,7 @@ import:
- zk - zk
- package: github.com/docker/libtrust - package: github.com/docker/libtrust
ref: 9cbd2a1374f46905c68a4eb3694a130610adc62a ref: 9cbd2a1374f46905c68a4eb3694a130610adc62a
- package: gopkg.in/check.v1 - package: github.com/go-check/check
ref: 11d3bc7aa68e238947792f30573146a3231fc0f1 ref: 11d3bc7aa68e238947792f30573146a3231fc0f1
- package: golang.org/x/net - package: golang.org/x/net
ref: d9558e5c97f85372afee28cf2b6059d7d3818919 ref: d9558e5c97f85372afee28cf2b6059d7d3818919
@ -39,7 +37,7 @@ import:
- package: github.com/alecthomas/template - package: github.com/alecthomas/template
ref: b867cc6ab45cece8143cfcc6fc9c77cf3f2c23c0 ref: b867cc6ab45cece8143cfcc6fc9c77cf3f2c23c0
- package: github.com/vdemeester/shakers - package: github.com/vdemeester/shakers
ref: 8fe734f75f3a70b651cbfbf8a55a009da09e8dc5 ref: 24d7f1d6a71aa5d9cbe7390e4afb66b7eef9e1b3
- package: github.com/alecthomas/units - package: github.com/alecthomas/units
ref: 6b4e7dc5e3143b85ea77909c72caf89416fc2915 ref: 6b4e7dc5e3143b85ea77909c72caf89416fc2915
- package: github.com/gambol99/go-marathon - package: github.com/gambol99/go-marathon
@ -48,8 +46,6 @@ import:
ref: cb0bff91a7ab7cf7571e661ff883fc997bc554a3 ref: cb0bff91a7ab7cf7571e661ff883fc997bc554a3
- package: github.com/thoas/stats - package: github.com/thoas/stats
ref: 54ed61c2b47e263ae2f01b86837b0c4bd1da28e8 ref: 54ed61c2b47e263ae2f01b86837b0c4bd1da28e8
- package: github.com/samalba/dockerclient
ref: cfb489c624b635251a93e74e1e90eb0959c5367f
- package: github.com/Sirupsen/logrus - package: github.com/Sirupsen/logrus
ref: 418b41d23a1bf978c06faea5313ba194650ac088 ref: 418b41d23a1bf978c06faea5313ba194650ac088
- package: github.com/unrolled/render - package: github.com/unrolled/render
@ -123,14 +119,6 @@ import:
ref: bd2bdf7f18f849530ef7a1c29a4290217cab32a1 ref: bd2bdf7f18f849530ef7a1c29a4290217cab32a1
- package: gopkg.in/alecthomas/kingpin.v2 - package: gopkg.in/alecthomas/kingpin.v2
ref: 639879d6110b1b0409410c7b737ef0bb18325038 ref: 639879d6110b1b0409410c7b737ef0bb18325038
- package: github.com/docker/libcompose
ref: e290a513ba909ca3afefd5cd611f3a3fe56f6a3a
subpackages:
- docker
- logger
- lookup
- project
- utils
- package: github.com/cenkalti/backoff - package: github.com/cenkalti/backoff
ref: 4dc77674aceaabba2c7e3da25d4c823edfb73f99 ref: 4dc77674aceaabba2c7e3da25d4c823edfb73f99
- package: gopkg.in/fsnotify.v1 - package: gopkg.in/fsnotify.v1
@ -166,5 +154,22 @@ import:
- package: github.com/stretchr/testify/mock - package: github.com/stretchr/testify/mock
- package: github.com/xenolf/lego - package: github.com/xenolf/lego
- package: github.com/vdemeester/libkermit - package: github.com/vdemeester/libkermit
ref: 01a5399bdbd3312916c9fa4848108fbc81fe88d8 ref: 9012902ed333111cf804fd5a28114d8a64002951
- package: github.com/docker/libcompose
version: e290a513ba909ca3afefd5cd611f3a3fe56f6a3a
- package: github.com/docker/distribution
version: ff6f38ccb69afa96214c7ee955359465d1fc767a
subpackages:
- reference
- package: github.com/docker/engine-api
subpackages:
- client
- types
- types/container
- types/filters
- types/strslice
- package: github.com/docker/go-connections
subpackages:
- nat
- package: github.com/docker/go-units
- package: github.com/mailgun/multibuf - package: github.com/mailgun/multibuf

View file

@ -6,8 +6,9 @@ import (
"time" "time"
"fmt" "fmt"
"github.com/go-check/check"
checker "github.com/vdemeester/shakers" checker "github.com/vdemeester/shakers"
check "gopkg.in/check.v1"
) )
// SimpleSuite // SimpleSuite

View file

@ -6,11 +6,11 @@ import (
"os/exec" "os/exec"
"time" "time"
"github.com/go-check/check"
"github.com/hashicorp/consul/api" "github.com/hashicorp/consul/api"
docker "github.com/vdemeester/libkermit/docker"
docker "github.com/vdemeester/libkermit/docker/check"
checker "github.com/vdemeester/shakers" checker "github.com/vdemeester/shakers"
check "gopkg.in/check.v1"
) )
// Consul catalog test suites // Consul catalog test suites
@ -22,16 +22,12 @@ type ConsulCatalogSuite struct {
} }
func (s *ConsulCatalogSuite) SetUpSuite(c *check.C) { func (s *ConsulCatalogSuite) SetUpSuite(c *check.C) {
project, err := docker.NewProjectFromEnv() s.project = docker.NewProjectFromEnv(c)
c.Assert(err, checker.IsNil, check.Commentf("Error while creating docker project"))
s.project = project
s.createComposeProject(c, "consul_catalog") s.createComposeProject(c, "consul_catalog")
err = s.composeProject.Start() s.composeProject.Start(c)
c.Assert(err, checker.IsNil, check.Commentf("Error starting project"))
consul, err := s.project.Inspect("integration-test-consul_catalog_consul_1") consul := s.project.Inspect(c, "integration-test-consul_catalog_consul_1")
c.Assert(err, checker.IsNil, check.Commentf("Error finding consul container"))
s.consulIP = consul.NetworkSettings.IPAddress s.consulIP = consul.NetworkSettings.IPAddress
config := api.DefaultConfig() config := api.DefaultConfig()
@ -98,8 +94,7 @@ func (s *ConsulCatalogSuite) TestSingleService(c *check.C) {
c.Assert(err, checker.IsNil) c.Assert(err, checker.IsNil)
defer cmd.Process.Kill() defer cmd.Process.Kill()
nginx, err := s.project.Inspect("integration-test-consul_catalog_nginx_1") nginx := s.project.Inspect(c, "integration-test-consul_catalog_nginx_1")
c.Assert(err, checker.IsNil, check.Commentf("Error finding nginx container"))
err = s.registerService("test", nginx.NetworkSettings.IPAddress, 80) err = s.registerService("test", nginx.NetworkSettings.IPAddress, 80)
c.Assert(err, checker.IsNil, check.Commentf("Error registering service")) c.Assert(err, checker.IsNil, check.Commentf("Error registering service"))

View file

@ -5,8 +5,9 @@ import (
"os/exec" "os/exec"
"time" "time"
"github.com/go-check/check"
checker "github.com/vdemeester/shakers" checker "github.com/vdemeester/shakers"
check "gopkg.in/check.v1"
) )
// Consul test suites (using libcompose) // Consul test suites (using libcompose)

View file

@ -11,10 +11,11 @@ import (
"time" "time"
"github.com/docker/docker/pkg/namesgenerator" "github.com/docker/docker/pkg/namesgenerator"
"github.com/vdemeester/libkermit/docker" "github.com/go-check/check"
d "github.com/vdemeester/libkermit/docker"
docker "github.com/vdemeester/libkermit/docker/check"
checker "github.com/vdemeester/shakers" checker "github.com/vdemeester/shakers"
check "gopkg.in/check.v1"
) )
var ( var (
@ -36,46 +37,42 @@ type DockerSuite struct {
} }
func (s *DockerSuite) startContainer(c *check.C, image string, args ...string) string { func (s *DockerSuite) startContainer(c *check.C, image string, args ...string) string {
return s.startContainerWithConfig(c, image, docker.ContainerConfig{ return s.startContainerWithConfig(c, image, d.ContainerConfig{
Cmd: args, Cmd: args,
}) })
} }
func (s *DockerSuite) startContainerWithLabels(c *check.C, image string, labels map[string]string, args ...string) string { func (s *DockerSuite) startContainerWithLabels(c *check.C, image string, labels map[string]string, args ...string) string {
return s.startContainerWithConfig(c, image, docker.ContainerConfig{ return s.startContainerWithConfig(c, image, d.ContainerConfig{
Cmd: args, Cmd: args,
Labels: labels, Labels: labels,
}) })
} }
func (s *DockerSuite) startContainerWithConfig(c *check.C, image string, config docker.ContainerConfig) string { func (s *DockerSuite) startContainerWithConfig(c *check.C, image string, config d.ContainerConfig) string {
if config.Name == "" { if config.Name == "" {
config.Name = namesgenerator.GetRandomName(10) config.Name = namesgenerator.GetRandomName(10)
} }
container, err := s.project.StartWithConfig(image, config) container := s.project.StartWithConfig(c, image, config)
c.Assert(err, checker.IsNil, check.Commentf("Error starting a container using config %v", config))
// FIXME(vdemeester) this is ugly (it's because of the / in front of the name in docker..) // FIXME(vdemeester) this is ugly (it's because of the / in front of the name in docker..)
return strings.SplitAfter(container.Name, "/")[1] return strings.SplitAfter(container.Name, "/")[1]
} }
func (s *DockerSuite) SetUpSuite(c *check.C) { func (s *DockerSuite) SetUpSuite(c *check.C) {
project, err := docker.NewProjectFromEnv() project := docker.NewProjectFromEnv(c)
c.Assert(err, checker.IsNil, check.Commentf("Error while creating docker project"))
s.project = project s.project = project
// Pull required images // Pull required images
for repository, tag := range RequiredImages { for repository, tag := range RequiredImages {
image := fmt.Sprintf("%s:%s", repository, tag) image := fmt.Sprintf("%s:%s", repository, tag)
s.project.Pull(image) s.project.Pull(c, image)
c.Assert(err, checker.IsNil, check.Commentf("Error while pulling image %s", image))
} }
} }
func (s *DockerSuite) TearDownTest(c *check.C) { func (s *DockerSuite) TearDownTest(c *check.C) {
err := s.project.Clean(os.Getenv("CIRCLECI") != "") s.project.Clean(c, os.Getenv("CIRCLECI") != "")
c.Assert(err, checker.IsNil, check.Commentf("Error while cleaning containers"))
} }
func (s *DockerSuite) TestSimpleConfiguration(c *check.C) { func (s *DockerSuite) TestSimpleConfiguration(c *check.C) {

View file

@ -5,8 +5,9 @@ import (
"os/exec" "os/exec"
"time" "time"
"github.com/go-check/check"
checker "github.com/vdemeester/shakers" checker "github.com/vdemeester/shakers"
check "gopkg.in/check.v1"
) )
// Etcd test suites (using libcompose) // Etcd test suites (using libcompose)

View file

@ -5,8 +5,9 @@ import (
"os/exec" "os/exec"
"time" "time"
"github.com/go-check/check"
checker "github.com/vdemeester/shakers" checker "github.com/vdemeester/shakers"
check "gopkg.in/check.v1"
) )
// File test suites // File test suites
@ -15,7 +16,7 @@ type FileSuite struct{ BaseSuite }
func (s *FileSuite) SetUpSuite(c *check.C) { func (s *FileSuite) SetUpSuite(c *check.C) {
s.createComposeProject(c, "file") s.createComposeProject(c, "file")
s.composeProject.Start() s.composeProject.Start(c)
} }
func (s *FileSuite) TestSimpleConfiguration(c *check.C) { func (s *FileSuite) TestSimpleConfiguration(c *check.C) {

View file

@ -8,8 +8,9 @@ import (
"os/exec" "os/exec"
"time" "time"
"github.com/go-check/check"
checker "github.com/vdemeester/shakers" checker "github.com/vdemeester/shakers"
check "gopkg.in/check.v1"
) )
// HTTPSSuite // HTTPSSuite

View file

@ -11,10 +11,10 @@ import (
"text/template" "text/template"
"github.com/containous/traefik/integration/utils" "github.com/containous/traefik/integration/utils"
"github.com/vdemeester/libkermit/compose" "github.com/go-check/check"
compose "github.com/vdemeester/libkermit/compose/check"
checker "github.com/vdemeester/shakers" checker "github.com/vdemeester/shakers"
check "gopkg.in/check.v1"
) )
func Test(t *testing.T) { func Test(t *testing.T) {
@ -41,17 +41,14 @@ type BaseSuite struct {
func (s *BaseSuite) TearDownSuite(c *check.C) { func (s *BaseSuite) TearDownSuite(c *check.C) {
// shutdown and delete compose project // shutdown and delete compose project
if s.composeProject != nil { if s.composeProject != nil {
err := s.composeProject.Stop() s.composeProject.Stop(c)
c.Assert(err, checker.IsNil)
} }
} }
func (s *BaseSuite) createComposeProject(c *check.C, name string) { func (s *BaseSuite) createComposeProject(c *check.C, name string) {
projectName := fmt.Sprintf("integration-test-%s", name) projectName := fmt.Sprintf("integration-test-%s", name)
composeFile := fmt.Sprintf("resources/compose/%s.yml", name) composeFile := fmt.Sprintf("resources/compose/%s.yml", name)
composeProject, err := compose.CreateProject(projectName, composeFile) s.composeProject = compose.CreateProject(c, projectName, composeFile)
c.Assert(err, checker.IsNil)
s.composeProject = composeProject
} }
func (s *BaseSuite) traefikCmd(c *check.C, args ...string) (*exec.Cmd, string) { func (s *BaseSuite) traefikCmd(c *check.C, args ...string) (*exec.Cmd, string) {

View file

@ -5,8 +5,9 @@ import (
"os/exec" "os/exec"
"time" "time"
"github.com/go-check/check"
checker "github.com/vdemeester/shakers" checker "github.com/vdemeester/shakers"
check "gopkg.in/check.v1"
) )
// Marathon test suites (using libcompose) // Marathon test suites (using libcompose)