From cc1c1f74a53fac4dc5dcfd6da0ccb94dbf8291e3 Mon Sep 17 00:00:00 2001 From: abhinandanpb Date: Sat, 12 Mar 2016 14:10:13 -0800 Subject: [PATCH 1/7] Sanity cases minor fix minor fix minor fix minor fix minor fix minor fix minor fix final push minor fixes final push minor fix minor fix changin test time out Changing ubuntu specific commands in tests minor fix fixing test case gofmt minor fix reducing num containers retry minor fix minor fix adapting to vagrant ssh changes retry retry retry retry final push --- .../github.com/contiv/vagrantssh/vagrant.go | 17 +- Makefile | 10 +- Vagrantfile | 73 +- netmaster/objApi/apiController.go | 28 + netplugin/netd.go | 7 + scripts/gobgp | Bin 0 -> 13810824 bytes systemtests/aci_test.go | 3 + systemtests/basic_test.go | 7 + systemtests/bgp_test.go | 930 ++++++++++++++++++ systemtests/container_test.go | 0 systemtests/init_test.go | 55 +- systemtests/network_test.go | 39 +- systemtests/policy_test.go | 33 + systemtests/trigger_test.go | 13 +- systemtests/util_test.go | 47 + 15 files changed, 1216 insertions(+), 46 deletions(-) mode change 100644 => 100755 Vagrantfile create mode 100755 scripts/gobgp mode change 100644 => 100755 systemtests/basic_test.go create mode 100755 systemtests/bgp_test.go mode change 100644 => 100755 systemtests/container_test.go mode change 100644 => 100755 systemtests/init_test.go mode change 100644 => 100755 systemtests/policy_test.go mode change 100644 => 100755 systemtests/trigger_test.go mode change 100644 => 100755 systemtests/util_test.go diff --git a/Godeps/_workspace/src/github.com/contiv/vagrantssh/vagrant.go b/Godeps/_workspace/src/github.com/contiv/vagrantssh/vagrant.go index 8b44b36dc..2297b7137 100644 --- a/Godeps/_workspace/src/github.com/contiv/vagrantssh/vagrant.go +++ b/Godeps/_workspace/src/github.com/contiv/vagrantssh/vagrant.go @@ -90,10 +90,10 @@ type Vagrant struct { // a string of values to prefix before each command run on each SSHNode. // numNodes is the number of nodes you want to track: these will be scanned // from the vagrant file sequentially. -func (v *Vagrant) setup(start bool, env string, numNodes int) error { +func (v *Vagrant) setup(start bool, env string, numContivNodes int, numIgnoreNodes int) error { v.nodes = map[string]TestbedNode{} - vCmd := &VagrantCommand{ContivNodes: numNodes, ContivEnv: env} + vCmd := &VagrantCommand{ContivNodes: numContivNodes, ContivEnv: env} if start { output, err := vCmd.RunWithOutput("up") @@ -110,7 +110,7 @@ func (v *Vagrant) setup(start bool, env string, numNodes int) error { }() } - v.expectedNodes = numNodes + v.expectedNodes = numContivNodes+numIgnoreNodes output, err := vCmd.RunWithOutput("status") if err != nil { @@ -135,11 +135,6 @@ func (v *Vagrant) setup(start bool, env string, numNodes int) error { nodeName := strings.Fields(string(nodeNameByte))[0] nodeNames = append(nodeNames, nodeName) } - if len(nodeNames) != numNodes { - err = fmt.Errorf("Number of running node(s) (%d) is not equal to number of expected node(s) (%d) in vagrant status output: \n%s\n", - len(nodeNames), numNodes, output) - return err - } // some more work to figure the ssh port and private key details // XXX: vagrant ssh-config --host <> seems to be broken as-in it doesn't @@ -214,7 +209,11 @@ func (v *Vagrant) Setup(args ...interface{}) error { if _, ok := args[2].(int); !ok { return unexpectedSetupArgError("bool, string, int", args...) } - return v.setup(args[0].(bool), args[1].(string), args[2].(int)) + if _, ok := args[3].(int); !ok { + return unexpectedSetupArgError("bool, string, int", args...) + } + + return v.setup(args[0].(bool), args[1].(string), args[2].(int),args[3].(int)) } // Teardown cleans up a vagrant testbed. It performs `vagrant destroy -f` to diff --git a/Makefile b/Makefile index 66ecc5da8..6a894fc91 100755 --- a/Makefile +++ b/Makefile @@ -94,8 +94,14 @@ unit-test: stop clean build centos-tests: CONTIV_NODE_OS=centos make clean build unit-test system-test stop -system-test: start - godep go test -v -timeout 120m ./systemtests -check.v +system-test:start + godep go test -v -timeout 240m ./systemtests -check.v + +l3-test: + CONTIV_L3=2 CONTIV_NODES=3 vagrant destroy -f + CONTIV_L3=2 CONTIV_NODES=3 vagrant up + CONTIV_L3=2 CONTIV_NODES=3 godep go test -v -timeout 240m ./systemtests -check.v + CONTIV_L3=2 CONTIV_NODES=3 vagrant destroy -f host-build: @echo "dev: making binaries..." diff --git a/Vagrantfile b/Vagrantfile old mode 100644 new mode 100755 index 0279a0d9e..fb3be7062 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,8 +24,8 @@ echo 'export GOSRC=$GOPATH/src' >> /etc/profile.d/envvar.sh echo 'export PATH=$PATH:/usr/local/go/bin:$GOBIN' >> /etc/profile.d/envvar.sh echo "export http_proxy='$4'" >> /etc/profile.d/envvar.sh echo "export https_proxy='$5'" >> /etc/profile.d/envvar.sh -echo "export no_proxy=192.168.2.10,192.168.2.11,127.0.0.1,localhost,netmaster" >> /etc/profile.d/envvar.sh -echo "export CLUSTER_NODE_IPS=192.168.2.10,192.168.2.11" >> /etc/profile.d/envvar.sh +echo "export no_proxy=192.168.2.10,192.168.2.11,127.0.0.1,localhost,netmaster,192.168.2.12" >> /etc/profile.d/envvar.sh +echo "export CLUSTER_NODE_IPS=192.168.2.10,192.168.2.11,192.168.2.12" >> /etc/profile.d/envvar.sh echo "export USE_RELEASE=$6" >> /etc/profile.d/envvar.sh @@ -43,7 +43,7 @@ systemctl enable docker-tcp.socket mkdir /etc/systemd/system/docker.service.d echo "[Service]" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf -echo "Environment=\\\"no_proxy=192.168.2.10,192.168.2.11,127.0.0.1,localhost,netmaster\\\" \\\"http_proxy=$http_proxy\\\" \\\"https_proxy=$https_proxy\\\"" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf +echo "Environment=\\\"no_proxy=192.168.2.10,192.168.2.11,192.168.2.12,127.0.0.1,localhost,netmaster\\\" \\\"http_proxy=$http_proxy\\\" \\\"https_proxy=$https_proxy\\\"" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf sudo systemctl daemon-reload sudo systemctl stop docker systemctl start docker-tcp.socket @@ -69,14 +69,20 @@ rm /etc/docker/key.json docker load --input #{gopath_folder}/src/github.com/contiv/netplugin/scripts/dnscontainer.tar SCRIPT +provision_bird = <