Skip to content

Ci acceptance test ovs #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/citest/acceptance-test/tests/00_ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"testing"
"time"
)

const zookeeper_ip = "10.0.100.10"
const mesos_master_ip = "10.0.100.11"
const scheduler_ip = "10.0.100.12"
const executor_null_ip = "10.0.100.13"
const executor_lxc_ip = "10.0.100.14"
const executor_lxc_ovs_ip = "10.0.100.15"

func RunSsh(ip string, cmd string) (*bytes.Buffer, *bytes.Buffer, error) {
var stdout bytes.Buffer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestLXCInstance(t *testing.T) {
RunSshWithTimeoutAndExpectFail(t, executor_lxc_ip, "sudo lxc-info -n "+instance_id, 10, 5)
}

func TestLXCInstance_NICx2(t *testing.T) {
func TestLXCInstance_LinuxBrNICx2(t *testing.T) {
stdout, _ := RunCmdAndReportFail(t, "openvdc", "run", "centos/7/lxc",
`{"interfaces":[{"type":"veth"}, {"type":"veth"}], "node_groups":["linuxbr"]}`)
instance_id := strings.TrimSpace(stdout.String())
Expand Down Expand Up @@ -55,7 +55,34 @@ func TestLXCInstance_NICx2(t *testing.T) {
t.Log("bridge link show dev "+instance_id+"_01: ", stdout.String())
}
}
RunCmdWithTimeoutAndReportFail(t, 10, 5, "openvdc", "destroy", instance_id)
WaitInstance(t, 5*time.Minute, instance_id, "TERMINATED", nil)
}

func TestLXCInstance_OvsNICx2(t *testing.T) {
stdout, _ := RunCmdAndReportFail(t, "openvdc", "run", "centos/7/lxc",
`{"interfaces":[{"type":"vif"}, {"type":"vif"}], "node_groups":["ovs"]}`)
instance_id := strings.TrimSpace(stdout.String())

RunCmdAndReportFail(t, "openvdc", "show", instance_id)
WaitInstance(t, 5*time.Minute, instance_id, "RUNNING", []string{"QUEUED", "STARTING"})
RunSshWithTimeoutAndReportFail(t, executor_lxc_ovs_ip, "sudo lxc-info -n "+instance_id, 10, 5)
stdout, _, err := RunSsh(executor_lxc_ovs_ip, fmt.Sprintf("sudo /usr/bin/ovs-vsctl port-to-br %s", instance_id+"_00"))
if err != nil {
t.Error(err)
} else {
if testing.Verbose() {
t.Log("ovs-vsctl port-to-br "+instance_id+"_00", stdout.String())
}
}
stdout, _, err = RunSsh(executor_lxc_ovs_ip, fmt.Sprintf("sudo /usr/bin/ovs-vsctl port-to-br %s", instance_id+"_01"))
if err != nil {
t.Error(err)
} else {
if testing.Verbose() {
t.Log("ovs-vsctl port-to-br "+instance_id+"_01", stdout.String())
}
}
RunCmdWithTimeoutAndReportFail(t, 10, 5, "openvdc", "destroy", instance_id)
WaitInstance(t, 5*time.Minute, instance_id, "TERMINATED", nil)
}