Skip to content

Commit 06a76ba

Browse files
author
Erik Hollensbe
committed
Merge pull request #155 from contiv/update-systemtests
Update systemtests
2 parents 1a4abbb + 3f2112b commit 06a76ba

File tree

12 files changed

+67
-57
lines changed

12 files changed

+67
-57
lines changed

Godeps/Godeps.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Godeps/_workspace/src/github.com/contiv/systemtests-utils/vagrantnode.go

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

systemtests/singlehost/regression_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"io/ioutil"
2020
"testing"
2121

22+
"github.com/contiv/netplugin/systemtests/utils"
2223
u "github.com/contiv/netplugin/utils"
23-
utils "github.com/contiv/systemtests-utils"
2424
)
2525

2626
func TestOneHostMultipleNets_regress(t *testing.T) {

systemtests/singlehost/sanity_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020
"testing"
2121
"time"
2222

23+
"github.com/contiv/netplugin/systemtests/utils"
2324
u "github.com/contiv/netplugin/utils"
24-
utils "github.com/contiv/systemtests-utils"
2525
)
2626

2727
// Testcase:

systemtests/singlehost/setup_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ import (
1919
"os"
2020
"testing"
2121

22-
utils "github.com/contiv/systemtests-utils"
23-
2422
log "github.com/Sirupsen/logrus"
23+
"github.com/contiv/netplugin/systemtests/utils"
24+
stu "github.com/contiv/systemtests-utils"
2525
)
2626

27-
var testbed utils.Testbed
27+
var testbed stu.Testbed
2828

2929
func TestMain(m *testing.M) {
3030
// setup a single node vagrant testbed
3131
if os.Getenv("CONTIV_TESTBED") == "DIND" {
32-
testbed = &utils.Dind{}
32+
testbed = &stu.Dind{}
3333
} else {
34-
testbed = &utils.Vagrant{}
34+
testbed = &stu.Vagrant{}
3535
}
3636
log.Printf("Starting testbed setup...")
3737
err := testbed.Setup(true, os.Getenv("CONTIV_ENV"), 1)

systemtests/twohosts/regression_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"io/ioutil"
2020
"testing"
2121

22+
"github.com/contiv/netplugin/systemtests/utils"
2223
u "github.com/contiv/netplugin/utils"
23-
utils "github.com/contiv/systemtests-utils"
2424
)
2525

2626
func TestMultipleEpsInContainer_regress(t *testing.T) {

systemtests/twohosts/sanity_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"testing"
2020
"time"
2121

22+
"github.com/contiv/netplugin/systemtests/utils"
2223
u "github.com/contiv/netplugin/utils"
23-
utils "github.com/contiv/systemtests-utils"
2424
)
2525

2626
func TestTwoHostsSingleVlanPingSuccess_sanity(t *testing.T) {

systemtests/twohosts/setup_test.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ import (
1919
"os"
2020
"testing"
2121

22-
utils "github.com/contiv/systemtests-utils"
22+
"github.com/contiv/netplugin/systemtests/utils"
23+
stu "github.com/contiv/systemtests-utils"
2324

2425
log "github.com/Sirupsen/logrus"
2526
)
2627

27-
var testbed utils.Testbed
28+
var testbed stu.Testbed
2829

2930
func TestMain(m *testing.M) {
3031
if os.Getenv("CONTIV_TESTBED") == "DIND" {
31-
testbed = &utils.Dind{}
32+
testbed = &stu.Dind{}
3233
} else {
33-
testbed = &utils.Vagrant{}
34+
testbed = &stu.Vagrant{}
3435
}
3536
log.Printf("Starting testbed setup...")
3637
err := testbed.Setup(true, os.Getenv("CONTIV_ENV"), 2)

Godeps/_workspace/src/github.com/contiv/systemtests-utils/docker.go systemtests/utils/docker.go

+14-12
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ import (
1919
"fmt"
2020
"strings"
2121
"testing"
22+
23+
stu "github.com/contiv/systemtests-utils"
2224
)
2325

2426
// DockerCleanupWithEnv kills and removes a container on a specified testbed node
2527
// and with specified env-variables
26-
func DockerCleanupWithEnv(t *testing.T, node TestbedNode, contName string, env []string) {
28+
func DockerCleanupWithEnv(t *testing.T, node stu.TestbedNode, contName string, env []string) {
2729
if !OkToCleanup(t.Failed()) {
2830
return
2931
}
@@ -34,15 +36,15 @@ func DockerCleanupWithEnv(t *testing.T, node TestbedNode, contName string, env [
3436
}
3537

3638
// DockerCleanup kills and removes a container on a specified testbed node
37-
func DockerCleanup(t *testing.T, node TestbedNode, contName string) {
39+
func DockerCleanup(t *testing.T, node stu.TestbedNode, contName string) {
3840
DockerCleanupWithEnv(t, node, contName, []string{})
3941
}
4042

4143
// StartServerWithEnvAndArgs starts a server container with specified env-variables
42-
func StartServerWithEnvAndArgs(t *testing.T, node TestbedNode, contName string,
44+
func StartServerWithEnvAndArgs(t *testing.T, node stu.TestbedNode, contName string,
4345
env, dockerArgs []string) {
4446
cmdStr := "sudo %s docker run -d %s --name=" + contName +
45-
" ubuntu /bin/bash -c 'mkfifo foo && < foo'"
47+
" ubuntu /bin/bash -c \"mkfifo foo && < foo\""
4648
cmdStr = fmt.Sprintf(cmdStr, strings.Join(env, " "),
4749
strings.Join(dockerArgs, " "))
4850
output, err := node.RunCommandWithOutput(cmdStr)
@@ -54,16 +56,16 @@ func StartServerWithEnvAndArgs(t *testing.T, node TestbedNode, contName string,
5456
}
5557

5658
// StartServer starts a server container
57-
func StartServer(t *testing.T, node TestbedNode, contName string) {
59+
func StartServer(t *testing.T, node stu.TestbedNode, contName string) {
5860
StartServerWithEnvAndArgs(t, node, contName, []string{}, []string{})
5961
}
6062

6163
// StartClientWithEnvAndArgs starts a client container with specified env-variables.
6264
// It expects ping to server container to succeed
63-
func StartClientWithEnvAndArgs(t *testing.T, node TestbedNode, contName, ipAddress string,
65+
func StartClientWithEnvAndArgs(t *testing.T, node stu.TestbedNode, contName, ipAddress string,
6466
env, dockerArgs []string) {
6567
cmdStr := "sudo %s docker run %s --name=" + contName +
66-
" ubuntu /bin/bash -c 'ping -c5 " + ipAddress + "'"
68+
" ubuntu /bin/bash -c \"ping -c5 " + ipAddress + "\""
6769
cmdStr = fmt.Sprintf(cmdStr, strings.Join(env, " "),
6870
strings.Join(dockerArgs, " "))
6971
output, err := node.RunCommandWithOutput(cmdStr)
@@ -90,16 +92,16 @@ func StartClientWithEnvAndArgs(t *testing.T, node TestbedNode, contName, ipAddre
9092
}
9193

9294
// StartClient starts a client container. It expects ping to server container to succeed
93-
func StartClient(t *testing.T, node TestbedNode, contName, ipAddress string) {
95+
func StartClient(t *testing.T, node stu.TestbedNode, contName, ipAddress string) {
9496
StartClientWithEnvAndArgs(t, node, contName, ipAddress, []string{}, []string{})
9597
}
9698

9799
// StartClientFailureWithEnvAndArgs starts a client container with specified env-variables.
98100
// It expects ping to server container to failure
99-
func StartClientFailureWithEnvAndArgs(t *testing.T, node TestbedNode, contName, ipAddress string,
101+
func StartClientFailureWithEnvAndArgs(t *testing.T, node stu.TestbedNode, contName, ipAddress string,
100102
env, dockerArgs []string) {
101103
cmdStr := "sudo %s docker run %s --name=" + contName +
102-
" ubuntu /bin/bash -c 'ping -c5 " + ipAddress + "'"
104+
" ubuntu /bin/bash -c \"ping -c5 " + ipAddress + "\""
103105
cmdStr = fmt.Sprintf(cmdStr, strings.Join(env, " "),
104106
strings.Join(dockerArgs, " "))
105107
output, err := node.RunCommandWithOutput(cmdStr)
@@ -117,11 +119,11 @@ func StartClientFailureWithEnvAndArgs(t *testing.T, node TestbedNode, contName,
117119
}
118120

119121
// StartClientFailure starts a client container. It expects ping to server container to fail
120-
func StartClientFailure(t *testing.T, node TestbedNode, contName, ipAddress string) {
122+
func StartClientFailure(t *testing.T, node stu.TestbedNode, contName, ipAddress string) {
121123
StartClientFailureWithEnvAndArgs(t, node, contName, ipAddress, []string{}, []string{})
122124
}
123125

124-
func getContainerUUID(node TestbedNode, contName string) (string, error) {
126+
func getContainerUUID(node stu.TestbedNode, contName string) (string, error) {
125127
cmdStr := "sudo docker inspect --format='{{.Id}}' " + contName
126128
output, err := node.RunCommandWithOutput(cmdStr)
127129
if err != nil {

Godeps/_workspace/src/github.com/contiv/systemtests-utils/ovs.go systemtests/utils/ovs.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ package utils
1717

1818
import (
1919
log "github.com/Sirupsen/logrus"
20+
stu "github.com/contiv/systemtests-utils"
2021
)
2122

2223
// OvsDumpInfo dumps the ovs state on the specified testbed node
23-
func OvsDumpInfo(node TestbedNode) {
24+
func OvsDumpInfo(node stu.TestbedNode) {
2425
cmdStr := "sudo ovs-vsctl show"
2526
output, _ := node.RunCommandWithOutput(cmdStr)
2627
log.Debugf("ovs-vsctl on node %s: \n%s\n", node.GetName(), output)

0 commit comments

Comments
 (0)