From 7594d22aa4209326d789e7e89e0c7b326a6ae6c8 Mon Sep 17 00:00:00 2001 From: Bill Robinson Date: Tue, 15 Nov 2016 13:42:09 -0800 Subject: [PATCH] *: fix misspellings project-wide and integrate `misspell` tool into 'checks' target to catch them Signed-off-by: Bill Robinson --- Makefile | 6 +++- core/core.go | 2 +- docs/Design.md | 6 ++-- mgmtfn/dockplugin/dockplugin.go | 2 +- mgmtfn/k8splugin/types.go | 4 +-- mgmtfn/mesosplugin/netcontiv/cniplugin.go | 4 +-- netmaster/daemon/daemon.go | 2 +- netmaster/daemon/utils.go | 4 +-- netmaster/master/provider.go | 2 +- netmaster/objApi/objapi_test.go | 34 +++++++++++------------ netplugin/agent/agent.go | 2 +- scripts/deps | 6 ++++ scripts/netContain/contivNet.sh | 2 +- scripts/python/api/container.py | 6 ++-- scripts/python/cleanup.py | 2 +- scripts/python/policyScale.py | 2 +- scripts/python/startPlugin.py | 2 +- scripts/python/startSwarm.py | 2 +- state/cfgtool/cfgtool.go | 6 ++-- state/consulstatedriver.go | 4 +-- state/etcdstatedriver.go | 4 +-- test/integration/mesos_test.go | 6 ++-- test/integration/utils_test.go | 2 +- test/systemtests/bgp_test.go | 2 +- test/systemtests/docker_test.go | 4 +-- test/systemtests/k8setup_test.go | 4 +-- test/systemtests/swarm_test.go | 4 +-- 27 files changed, 68 insertions(+), 58 deletions(-) diff --git a/Makefile b/Makefile index 33c3f519c..9c3495839 100755 --- a/Makefile +++ b/Makefile @@ -55,6 +55,10 @@ govet-src: $(PKG_DIRS) $(info +++ govet $(PKG_DIRS)) @for dir in $?; do $(GOVET_CMD) $${dir} || exit 1;done +misspell-src: $(PKG_DIRS) + $(info +++ check spelling $(PKG_DIRS)) + misspell -locale US -error $? + go-version: $(info +++ check go version) ifneq ($(GO_VERSION), $(lastword $(sort $(GO_VERSION) $(GO_MIN_VERSION)))) @@ -64,7 +68,7 @@ ifneq ($(GO_VERSION), $(firstword $(sort $(GO_VERSION) $(GO_MAX_VERSION)))) $(error go version check failed, expected <= $(GO_MAX_VERSION), found $(GO_VERSION)) endif -checks: go-version gofmt-src golint-src govet-src +checks: go-version gofmt-src golint-src govet-src misspell-src # We cannot perform sudo inside a golang, the only reason to split the rules # here diff --git a/core/core.go b/core/core.go index 2b826d1e6..bbc04f6e2 100755 --- a/core/core.go +++ b/core/core.go @@ -21,7 +21,7 @@ limitations under the License. // hardware/kernel/device specific programming implementation, if any. package core -// Address is a string represenation of a network address (mac, ip, dns-name, url etc) +// Address is a string representation of a network address (mac, ip, dns-name, url etc) type Address struct { addr string } diff --git a/docs/Design.md b/docs/Design.md index 77c186bbe..72671f286 100644 --- a/docs/Design.md +++ b/docs/Design.md @@ -23,7 +23,7 @@ This section provides a brief overview of some terms used in rest of the documen In application delivery environments, a management system coordinates the efforts of agents to accomplish the goal of placing applications in a cluster of resources (like compute, storage and network) based on their requirements, using the available resources efficiently and effectively. The management system also provides a front end (a central command control) to accept/input the application requirements. In other contexts, application delivery environments are also referred to as orchestration or scheduling platforms, container runtimes etc and the applications are also referred to as compute jobs or services. -In application delivery environments there is usually atleast one agent per managed resource. And the application requirements may include (but are not limited to) specification of resource constraints and affinities; communication patterns etc. +In application delivery environments there is usually at least one agent per managed resource. And the application requirements may include (but are not limited to) specification of resource constraints and affinities; communication patterns etc. Unless explicitly stated otherwise, for the logic performed at the managed resource the Management Function refers to the agent running on that resource, otherwise it refers to the central command control for the user facing logic like accepting/processing application requirement. @@ -44,7 +44,7 @@ Logically centralized decision making refers to the act of reaching consensus on ##Design Goals Integrating a management function with a network function usually requires a coupling of the two, thereby resulting in following challenges: -- There is often unclarity/uncertainity of the definition of the integrating interfaces between the two without an available implementation of atleast one. This becomes even harder if both the implementations are a work in progress by independent teams, which is usually the case. +- There is often unclarity/uncertainty of the definition of the integrating interfaces between the two without an available implementation of at least one. This becomes even harder if both the implementations are a work in progress by independent teams, which is usually the case. - It is difficulty to intermix the available implementations of functions without re-writing/modifying the functions themselves. - There is a risk of exposing network function configuration (usually technology specific, imperative, procedural in nature) as management function configuration (which can be intent-based/declarative, promise-based etc), thereby complicating user experience. Example, to use a switch capable of supporting multi-teanancy using vlans and qos if the APIs exposed by the management function need to take care of specifying these values then it impedes defining a high-level API at management function. @@ -148,7 +148,7 @@ As discussed above the Plugin interface implementation invokes the Driver interf 4. Resource deallocation for a network (vlan ids, vxlan ids) and endpoint (ip address) happens before the deletion of network and endpoint respectively. Notes: - - The above constraints provide guarantees wrt the order of Driver interface invocation. However, they do not guarantee the presence/absence of the state when the Driver interface is actually invoked. The driver implementations are expected to deal with such scenarios. Example, when a delete for endpoint is received it is not guranteed that the network state will exist. So a driver implementation might need to cache/keep enough state to handle endpoint deletion gracefully. + - The above constraints provide guarantees wrt the order of Driver interface invocation. However, they do not guarantee the presence/absence of the state when the Driver interface is actually invoked. The driver implementations are expected to deal with such scenarios. Example, when a delete for endpoint is received it is not guaranteed that the network state will exist. So a driver implementation might need to cache/keep enough state to handle endpoint deletion gracefully. - The Constraints 'c' and 'd' might become out of scope of the Plugin interface based on design approach we pick. See section on [open design items](#open-items-and-ongoing-work>) ##Integration Details diff --git a/mgmtfn/dockplugin/dockplugin.go b/mgmtfn/dockplugin/dockplugin.go index cce5d0228..d66c0948a 100644 --- a/mgmtfn/dockplugin/dockplugin.go +++ b/mgmtfn/dockplugin/dockplugin.go @@ -129,7 +129,7 @@ func httpError(w http.ResponseWriter, message string, err error) { content, errc := json.Marshal(api.Response{Err: fullError}) if errc != nil { - log.Warnf("Error received marshalling error response: %v, original error: %s", errc, fullError) + log.Warnf("Error received marshaling error response: %v, original error: %s", errc, fullError) return } diff --git a/mgmtfn/k8splugin/types.go b/mgmtfn/k8splugin/types.go index c6c0c14da..9abb5e303 100644 --- a/mgmtfn/k8splugin/types.go +++ b/mgmtfn/k8splugin/types.go @@ -195,7 +195,7 @@ const ( ServiceAffinityNone ServiceAffinity = "None" ) -// Protocol defines network protocols supported for things like conatiner ports. +// Protocol defines network protocols supported for things like container ports. type Protocol string const ( @@ -288,7 +288,7 @@ type ServiceSpec struct { SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty"` } -// ServicePort conatins information on service's port. +// ServicePort contains information on service's port. type ServicePort struct { // The name of this port within the service. This must be a DNS_LABEL. // All ports within a ServiceSpec must have unique names. This maps to diff --git a/mgmtfn/mesosplugin/netcontiv/cniplugin.go b/mgmtfn/mesosplugin/netcontiv/cniplugin.go index cf7ecb201..9176af2ce 100644 --- a/mgmtfn/mesosplugin/netcontiv/cniplugin.go +++ b/mgmtfn/mesosplugin/netcontiv/cniplugin.go @@ -194,7 +194,7 @@ func (cniApp *cniAppInfo) handleHTTP(url string, jsonReq *bytes.Buffer) int { switch httpResp.StatusCode { case http.StatusOK: - cniLog.Infof("received http OK reponse from netplugin") + cniLog.Infof("received http OK response from netplugin") info, err := ioutil.ReadAll(httpResp.Body) if err != nil { return cniApp.sendCniErrorResp("failed to read success response from netplugin :" + err.Error()) @@ -202,7 +202,7 @@ func (cniApp *cniAppInfo) handleHTTP(url string, jsonReq *bytes.Buffer) int { return cniApp.sendCniResp(info, cniapi.CniStatusSuccess) case http.StatusInternalServerError: - cniLog.Infof("received http error reponse from netplugin") + cniLog.Infof("received http error response from netplugin") info, err := ioutil.ReadAll(httpResp.Body) if err != nil { return cniApp.sendCniErrorResp("failed to read error response from netplugin :" + err.Error()) diff --git a/netmaster/daemon/daemon.go b/netmaster/daemon/daemon.go index 02955e455..2b419c26d 100755 --- a/netmaster/daemon/daemon.go +++ b/netmaster/daemon/daemon.go @@ -200,7 +200,7 @@ func (d *MasterDaemon) registerRoutes(router *mux.Router) { resp, err := json.Marshal(info) if err != nil { http.Error(w, - core.Errorf("marshalling json failed. Error: %s", err).Error(), + core.Errorf("marshaling json failed. Error: %s", err).Error(), http.StatusInternalServerError) return } diff --git a/netmaster/daemon/utils.go b/netmaster/daemon/utils.go index 49a89664e..d433efec4 100755 --- a/netmaster/daemon/utils.go +++ b/netmaster/daemon/utils.go @@ -42,7 +42,7 @@ func getVersion(w http.ResponseWriter, r *http.Request) { resp, err := json.Marshal(ver) if err != nil { http.Error(w, - core.Errorf("marshalling json failed. Error: %s", err).Error(), + core.Errorf("marshaling json failed. Error: %s", err).Error(), http.StatusInternalServerError) return } @@ -185,7 +185,7 @@ func get(getAll bool, hook func(id string) ([]core.State, error)) func(http.Resp if resp, err = json.Marshal(states); err != nil { http.Error(w, - core.Errorf("marshalling json failed. Error: %s", err).Error(), + core.Errorf("marshaling json failed. Error: %s", err).Error(), http.StatusInternalServerError) return } diff --git a/netmaster/master/provider.go b/netmaster/master/provider.go index 7d108c6f7..c0f0b5be5 100755 --- a/netmaster/master/provider.go +++ b/netmaster/master/provider.go @@ -21,7 +21,7 @@ import ( "github.com/contiv/netplugin/utils" ) -//SvcProviderUpdate propogates service provider updates to netplugins +//SvcProviderUpdate propagates service provider updates to netplugins func SvcProviderUpdate(serviceID string, isDelete bool) error { providerList := []string{} diff --git a/netmaster/objApi/objapi_test.go b/netmaster/objApi/objapi_test.go index 2b2f7191e..01d5cab40 100755 --- a/netmaster/objApi/objapi_test.go +++ b/netmaster/objApi/objapi_test.go @@ -130,7 +130,7 @@ func cleanupState() { } } -// checkError checks for error and fails teh test +// checkError checks for error and fails the test func checkError(t *testing.T, testStr string, err error) { if err != nil { t.Fatalf("Error during %s. Err: %v", testStr, err) @@ -405,7 +405,7 @@ func checkCreateNetProfile(t *testing.T, expError bool, dscp, burst int, bandwid if err != nil && !expError { t.Fatalf("Error creating Netprofile {%+v}. Err: %v", np, err) } else if err == nil && expError { - t.Fatalf("Create NetProfile {%+v} succeded while expecing error", np) + t.Fatalf("Create NetProfile {%+v} succeeded while expecing error", np) } else if err == nil { //check if netprofile is created. _, err := contivClient.NetprofileGet(tenantName, profileName) @@ -435,7 +435,7 @@ func checkDeleteNetProfile(t *testing.T, expError bool, profileName, tenantName if err != nil && !expError { t.Fatalf("Error deleting Netprofile %s/%s Err: %v", profileName, tenantName, err) } else if err == nil && expError { - t.Fatalf("delete NetProfile %s/%s succeded while expecing error", profileName, tenantName) + t.Fatalf("delete NetProfile %s/%s succeeded while expecing error", profileName, tenantName) } else if err == nil { //check if netprofile is deleted. _, err := contivClient.NetprofileGet(tenantName, profileName) @@ -491,7 +491,7 @@ func checkCreateEpgNp(t *testing.T, expError bool, tenant, ProfileName, network, if err != nil && !expError { t.Fatalf("Error creating epg {%+v}. Err: %v", epg, err) } else if err == nil && expError { - t.Fatalf("Create epg {%+v} succeded while expecing error", epg) + t.Fatalf("Create epg {%+v} succeeded while expecing error", epg) } else if err == nil { // verify epg is created _, err := contivClient.EndpointGroupGet(tenant, group) @@ -834,34 +834,34 @@ func TestTenantAddDelete(t *testing.T) { // Try creating invalid names and verify we get an error if contivClient.TenantPost(&client.Tenant{TenantName: "tenant:invalid"}) == nil { - t.Fatalf("tenant create succedded while expecting error") + t.Fatalf("tenant create succeeded while expecting error") } if contivClient.TenantPost(&client.Tenant{TenantName: "tenant|invalid"}) == nil { - t.Fatalf("tenant create succedded while expecting error") + t.Fatalf("tenant create succeeded while expecting error") } if contivClient.TenantPost(&client.Tenant{TenantName: "tenant\\invalid"}) == nil { - t.Fatalf("tenant create succedded while expecting error") + t.Fatalf("tenant create succeeded while expecting error") } if contivClient.TenantPost(&client.Tenant{TenantName: "tenant#invalid"}) == nil { - t.Fatalf("tenant create succedded while expecting error") + t.Fatalf("tenant create succeeded while expecting error") } if contivClient.TenantPost(&client.Tenant{TenantName: "-tenant"}) == nil { - t.Fatalf("tenant create succedded while expecting error") + t.Fatalf("tenant create succeeded while expecting error") } if contivClient.TenantPost(&client.Tenant{TenantName: "tenant@invalid"}) == nil { - t.Fatalf("tenant create succedded while expecting error") + t.Fatalf("tenant create succeeded while expecting error") } if contivClient.TenantPost(&client.Tenant{TenantName: "tenant!invalid"}) == nil { - t.Fatalf("tenant create succedded while expecting error") + t.Fatalf("tenant create succeeded while expecting error") } if contivClient.TenantPost(&client.Tenant{TenantName: "tenant~invalid"}) == nil { - t.Fatalf("tenant create succedded while expecting error") + t.Fatalf("tenant create succeeded while expecting error") } if contivClient.TenantPost(&client.Tenant{TenantName: "tenant*invalid"}) == nil { - t.Fatalf("tenant create succedded while expecting error") + t.Fatalf("tenant create succeeded while expecting error") } if contivClient.TenantPost(&client.Tenant{TenantName: "tenant^invalid"}) == nil { - t.Fatalf("tenant create succedded while expecting error") + t.Fatalf("tenant create succeeded while expecting error") } // delete tenant @@ -1921,11 +1921,11 @@ func verifyServiceCreate(t *testing.T, tenant, network, serviceName string, port } if serviceLbState.IPAddress == "" { - t.Fatalf("Service Created does not have an ip addres allocated") + t.Fatalf("Service Created does not have an ip address allocated") } if preferredIP != "" && serviceLbState.IPAddress != preferredIP { - t.Fatalf("Service Created does not have preferred ip addres allocated") + t.Fatalf("Service Created does not have preferred ip address allocated") } } @@ -2100,7 +2100,7 @@ func get(getAll bool, hook func(id string) ([]core.State, error)) func(http.Resp if resp, err = json.Marshal(states); err != nil { http.Error(w, - core.Errorf("marshalling json failed. Error: %s", err).Error(), + core.Errorf("marshaling json failed. Error: %s", err).Error(), http.StatusInternalServerError) return } diff --git a/netplugin/agent/agent.go b/netplugin/agent/agent.go index 1533a82e9..06ff3cb42 100644 --- a/netplugin/agent/agent.go +++ b/netplugin/agent/agent.go @@ -218,7 +218,7 @@ func (ag *Agent) HandleEvents() error { } err := <-recvErr if err != nil { - log.Errorf("Failure occured. Error: %s", err) + log.Errorf("Failure occurred. Error: %s", err) return err } diff --git a/scripts/deps b/scripts/deps index bc41d47a1..5d12e9d1a 100755 --- a/scripts/deps +++ b/scripts/deps @@ -10,6 +10,12 @@ then exit 1 fi +if ! go get -u github.com/client9/misspell/cmd/misspell +then + echo "!!! Could not install misspell" + exit 1 +fi + # this is necessary because presumably the `vet` tool needs to be installed in # $GOROOT. I have not investigated the reason fully yet. # the check right below this line is to avoid a sudo call on each invocation, diff --git a/scripts/netContain/contivNet.sh b/scripts/netContain/contivNet.sh index 780fd7c98..24d25b325 100755 --- a/scripts/netContain/contivNet.sh +++ b/scripts/netContain/contivNet.sh @@ -12,7 +12,7 @@ netplugin=false vlan_if="invalid" #This needs to be fixed, we cant rely on the value being supplied from -# paramters, just explosion of parameters is not a great solution +# parameters, just explosion of parameters is not a great solution #export no_proxy="0.0.0.0, 172.28.11.253" #echo "172.28.11.253 netmaster" > /etc/hosts diff --git a/scripts/python/api/container.py b/scripts/python/api/container.py index 9b7a616c6..042ea9b79 100644 --- a/scripts/python/api/container.py +++ b/scripts/python/api/container.py @@ -39,7 +39,7 @@ def execCmd(self, cmd): return self.node.runCmd("docker exec " + self.cid + " " + cmd) return out, err, exitCode - # Execute a command inside a container in backgroud + # Execute a command inside a container in background def execBgndCmd(self, cmd): out, err, exitCode = self.node.runCmd("docker exec -d " + self.cid + " " + cmd) # Retry failures once to workaround docker issue #15713 @@ -90,7 +90,7 @@ def checkPing(self, ipAddr): print err tutils.exit("Ping failed") - # Check if ping succeded + # Check if ping succeeded pingOutput = ''.join(out) if "0 received, 100% packet loss" in pingOutput: print "Ping failed. Output: " + pingOutput @@ -108,7 +108,7 @@ def checkPingFailure(self, ipAddr): tutils.log("Ping failed as expected.") return True - # Check if ping succeded + # Check if ping succeeded if "0 received, 100% packet loss" in pingOutput: tutils.log("Ping failed as expected. Output: " + pingOutput) return True diff --git a/scripts/python/cleanup.py b/scripts/python/cleanup.py index 3ed2f90a9..60a26fc32 100755 --- a/scripts/python/cleanup.py +++ b/scripts/python/cleanup.py @@ -10,7 +10,7 @@ # Create the parser and sub parser parser = argparse.ArgumentParser() parser.add_argument('--version', action='version', version='1.0.0') -parser.add_argument("-nodes", required=True, help="list of nodes(comma seperated)") +parser.add_argument("-nodes", required=True, help="list of nodes(comma separated)") parser.add_argument("-user", default='vagrant', help="User id for ssh") parser.add_argument("-password", default='vagrant', help="password for ssh") diff --git a/scripts/python/policyScale.py b/scripts/python/policyScale.py index e6ac94021..aaad51f32 100755 --- a/scripts/python/policyScale.py +++ b/scripts/python/policyScale.py @@ -42,7 +42,7 @@ def testConnections(testbed, numContainer): if testbed.checkConnections(containers, 8000, True) != True: api.tutils.exit("Connection failed") if testbed.checkConnections(containers, 7999, False) != False: - api.tutils.exit("Connection succeded while expecting it to fail") + api.tutils.exit("Connection succeeded while expecting it to fail") # stop netcast listeners testbed.stopListeners(containers) diff --git a/scripts/python/startPlugin.py b/scripts/python/startPlugin.py index e65f27b36..8cb104c79 100755 --- a/scripts/python/startPlugin.py +++ b/scripts/python/startPlugin.py @@ -11,7 +11,7 @@ # Create the parser and sub parser parser = argparse.ArgumentParser() parser.add_argument('--version', action='version', version='1.0.0') -parser.add_argument("-nodes", required=True, help="list of nodes(comma seperated)") +parser.add_argument("-nodes", required=True, help="list of nodes(comma separated)") parser.add_argument("-user", default='vagrant', help="User id for ssh") parser.add_argument("-password", default='vagrant', help="password for ssh") parser.add_argument("-binpath", default='/opt/gopath/bin', help="netplugin/netmaster binary path") diff --git a/scripts/python/startSwarm.py b/scripts/python/startSwarm.py index 811a91f50..aa971eaf7 100755 --- a/scripts/python/startSwarm.py +++ b/scripts/python/startSwarm.py @@ -10,7 +10,7 @@ # Parse command line args # Create the parser and sub parser parser = argparse.ArgumentParser() -parser.add_argument("-nodes", required=True, help="list of nodes(comma seperated)") +parser.add_argument("-nodes", required=True, help="list of nodes(comma separated)") parser.add_argument("-user", default='vagrant', help="User id for ssh") parser.add_argument("-password", default='vagrant', help="password for ssh") parser.add_argument("-binpath", default='/opt/gopath/bin', help="netplugin/netmaster binary path") diff --git a/state/cfgtool/cfgtool.go b/state/cfgtool/cfgtool.go index 67e1fbfbb..85fff663b 100644 --- a/state/cfgtool/cfgtool.go +++ b/state/cfgtool/cfgtool.go @@ -179,7 +179,7 @@ func processResource(stateDriver core.StateDriver, rsrcName, rsrcVal string) err func processState(stateDriver core.StateDriver, stateName, stateID, fieldName, setVal string) error { var typeRegistry = make(map[string]core.State) - // build the type registery + // build the type registry typeRegistry[reflect.TypeOf(mastercfg.CfgEndpointState{}).Name()] = &mastercfg.CfgEndpointState{} typeRegistry[reflect.TypeOf(mastercfg.CfgNetworkState{}).Name()] = &mastercfg.CfgNetworkState{} typeRegistry[reflect.TypeOf(mastercfg.CfgBgpState{}).Name()] = &mastercfg.CfgBgpState{} @@ -231,7 +231,7 @@ func processState(stateDriver core.StateDriver, stateName, stateID, fieldName, s // print the object content, err := json.MarshalIndent(cfgType, "", " ") if err != nil { - log.Errorf("Error marshalling json: %+v", cfgType) + log.Errorf("Error marshaling json: %+v", cfgType) return err } fmt.Printf("Current value of id: %s{ id: %s }\n%s\n", stateName, stateID, content) @@ -282,7 +282,7 @@ func processState(stateDriver core.StateDriver, stateName, stateID, fieldName, s // print the modified object content, err := json.MarshalIndent(cfgType, "", " ") if err != nil { - log.Errorf("Error marshalling json: %+v", cfgType) + log.Errorf("Error marshaling json: %+v", cfgType) return err } fmt.Printf("Writing values:\n%s\n", content) diff --git a/state/consulstatedriver.go b/state/consulstatedriver.go index 4ef55474b..1c2add5e0 100644 --- a/state/consulstatedriver.go +++ b/state/consulstatedriver.go @@ -261,7 +261,7 @@ func (d *ConsulStateDriver) ClearState(key string) error { return err } -// ReadState reads key into a core.State with the unmarshalling function. +// ReadState reads key into a core.State with the unmarshaling function. func (d *ConsulStateDriver) ReadState(key string, value core.State, unmarshal func([]byte, interface{}) error) error { key = processKey(key) @@ -304,7 +304,7 @@ func (d *ConsulStateDriver) WatchAllState(baseKey string, sType core.State, } -// WriteState writes a value of core.State into a key with a given marshalling function. +// WriteState writes a value of core.State into a key with a given marshaling function. func (d *ConsulStateDriver) WriteState(key string, value core.State, marshal func(interface{}) ([]byte, error)) error { key = processKey(key) diff --git a/state/etcdstatedriver.go b/state/etcdstatedriver.go index e4814fcd9..829663b25 100644 --- a/state/etcdstatedriver.go +++ b/state/etcdstatedriver.go @@ -202,7 +202,7 @@ func (d *EtcdStateDriver) ClearState(key string) error { return err } -// ReadState reads key into a core.State with the unmarshalling function. +// ReadState reads key into a core.State with the unmarshaling function. func (d *EtcdStateDriver) ReadState(key string, value core.State, unmarshal func([]byte, interface{}) error) error { encodedState, err := d.Read(key) @@ -322,7 +322,7 @@ func (d *EtcdStateDriver) WatchAllState(baseKey string, sType core.State, } -// WriteState writes a value of core.State into a key with a given marshalling function. +// WriteState writes a value of core.State into a key with a given marshaling function. func (d *EtcdStateDriver) WriteState(key string, value core.State, marshal func(interface{}) ([]byte, error)) error { encodedState, err := marshal(value) diff --git a/test/integration/mesos_test.go b/test/integration/mesos_test.go index 2c89583f7..6cf8367af 100644 --- a/test/integration/mesos_test.go +++ b/test/integration/mesos_test.go @@ -313,20 +313,20 @@ func processHTTP(c *C, url string, jsonReq *bytes.Buffer) (int, []byte) { switch httpResp.StatusCode { case http.StatusOK: - intLog.Infof("received http OK reponse from netplugin") + intLog.Infof("received http OK response from netplugin") info, err := ioutil.ReadAll(httpResp.Body) assertNoErr(err, c, "receive http data") return httpResp.StatusCode, info case http.StatusInternalServerError: - intLog.Infof("received http error reponse from netplugin") + intLog.Infof("received http error response from netplugin") info, err := ioutil.ReadAll(httpResp.Body) assertNoErr(err, c, "receive http data") return httpResp.StatusCode, info default: intLog.Errorf("received unknown error from netplugin") - assertNoErr(fmt.Errorf("unknwon error from netplugin"), c, "unknown") + assertNoErr(fmt.Errorf("unknown error from netplugin"), c, "unknown") } return 0, nil diff --git a/test/integration/utils_test.go b/test/integration/utils_test.go index 36aff0b64..9c8467979 100644 --- a/test/integration/utils_test.go +++ b/test/integration/utils_test.go @@ -353,7 +353,7 @@ func tcFilterCheckBw(expBw, expBurst int64) error { // verify expected rate expBw = expBw * 1024 * 1024 / 1000 if expBw != outputInt { - log.Errorf("Applied bandiwdth: %dkbits does not match the tc rate: %d\n Output: %s", expBw, outputInt, str) + log.Errorf("Applied bandwidth: %dkbits does not match the tc rate: %d\n Output: %s", expBw, outputInt, str) return errors.New("Applied bandwidth does not match the tc qdisc rate") } diff --git a/test/systemtests/bgp_test.go b/test/systemtests/bgp_test.go index f933905b0..1866bdadc 100755 --- a/test/systemtests/bgp_test.go +++ b/test/systemtests/bgp_test.go @@ -147,7 +147,7 @@ func (s *systemtestSuite) TestBgpContainerToNonContainerPing(c *C) { 1) Checks withdrawal of bgp external routes learnt on Peer 2) Checks readdition of external routes on peer up 3) Checks ping success to remote endpoints -4) Checks bgp peering and route distribution for pre exsiting containers (before bgp peering) +4) Checks bgp peering and route distribution for pre existing containers (before bgp peering) */ func (s *systemtestSuite) TestBgpTriggerPeerAddDelete(c *C) { if s.fwdMode != "routing" { diff --git a/test/systemtests/docker_test.go b/test/systemtests/docker_test.go index c6c71a922..3d565d7a5 100755 --- a/test/systemtests/docker_test.go +++ b/test/systemtests/docker_test.go @@ -294,7 +294,7 @@ func (d *docker) startIperfClient(c *container, ip, limit string, isErr bool) er } if success { - logrus.Infof("starting iperf client on conatiner:%s for server ip: %s", c, ip) + logrus.Infof("starting iperf client on container:%s for server ip: %s", c, ip) bwFormat := strings.Split(bw, "Server Report:") bwString := strings.Split(bwFormat[1], "Bytes ") newBandwidth := strings.Split(bwString[1], "bits/sec") @@ -382,7 +382,7 @@ func (d *docker) tcFilterShow(bw string) error { if bwInt == outputInt { logrus.Infof("Applied bandwidth: %dkbits equals tc qdisc rate: %dkbits", bwInt, outputInt) } else { - logrus.Errorf("Applied bandiwdth: %dkbits does not match the tc rate: %d ", bwInt, outputInt) + logrus.Errorf("Applied bandwidth: %dkbits does not match the tc rate: %d ", bwInt, outputInt) return errors.New("Applied bandwidth does not match the tc qdisc rate") } return nil diff --git a/test/systemtests/k8setup_test.go b/test/systemtests/k8setup_test.go index 6d4620ea0..5fb3c4f40 100755 --- a/test/systemtests/k8setup_test.go +++ b/test/systemtests/k8setup_test.go @@ -371,8 +371,8 @@ func (k *kubernetes) tcFilterShow(bw string) error { if bwInt == outputInt { logrus.Infof("Applied bandwidth: %dkbits equals tc qdisc rate: %dkbits", bwInt, outputInt) } else { - logrus.Errorf("Applied bandiwdth: %dkbits does not match the tc rate: %d ", bwInt, outputInt) - return errors.New("Applied bandwidth doe sot match teh tc qdisc rate") + logrus.Errorf("Applied bandwidth: %dkbits does not match the tc rate: %d ", bwInt, outputInt) + return errors.New("Applied bandwidth doe sot match the tc qdisc rate") } return nil } diff --git a/test/systemtests/swarm_test.go b/test/systemtests/swarm_test.go index 0b5a56674..44c094f36 100644 --- a/test/systemtests/swarm_test.go +++ b/test/systemtests/swarm_test.go @@ -285,7 +285,7 @@ func (w *swarm) startIperfClient(c *container, ip, limit string, isErr bool) err } if success { - logrus.Infof("starting iperf client on conatiner:%s for server ip: %s", c, ip) + logrus.Infof("starting iperf client on container:%s for server ip: %s", c, ip) bwFormat := strings.Split(bw, "Server Report:") bwString := strings.Split(bwFormat[1], "Bytes ") newBandwidth := strings.Split(bwString[1], "bits/sec") @@ -344,7 +344,7 @@ func (w *swarm) tcFilterShow(bw string) error { if bwInt == outputInt { logrus.Infof("Applied bandwidth: %dkbits equals tc qdisc rate: %dkbits", bwInt, outputInt) } else { - logrus.Errorf("Applied bandiwdth: %dkbits does not match the tc rate: %d ", bwInt, outputInt) + logrus.Errorf("Applied bandwidth: %dkbits does not match the tc rate: %d ", bwInt, outputInt) return errors.New("Applied bandwidth does not match the tc qdisc rate") } return nil