This will add a new target (fixstyle) to Makefile that runs gofmt tool.
Type: style
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Icba60633f82aa8bbc75749f080e00f0375b55a18
docker:
bash ./script/build.sh
+fixstyle:
+ @gofmt -w .
+
.PHONY: docker
}
if _, ok := yamlInput["volumes"]; ok {
- r:= strings.NewReplacer("$HST_DIR", workDir)
+ r := strings.NewReplacer("$HST_DIR", workDir)
for _, volu := range yamlInput["volumes"].([]interface{}) {
volumeMap := volu.(ContainerConfig)
hostDir := r.Replace(volumeMap["host-dir"].(string))
container.addVolume(hostDir, containerDir)
if isDefaultWorkDir, ok := volumeMap["is-default-work-dir"]; ok &&
- isDefaultWorkDir.(bool) &&
- len(container.workDir) == 0 {
+ isDefaultWorkDir.(bool) &&
+ len(container.workDir) == 0 {
container.workDir = containerDir
}
var clnRes = make(chan string, 1)
clnEnv := append(os.Environ(), ldpreload, "VCL_CONFIG="+clnVcl)
go StartClientApp(clnEnv, clnCh, clnRes)
- s.log(<- clnRes)
+ s.log(<-clnRes)
// wait for client's result
err = <-clnCh
s.log("server running")
go StartClientApp(nil, clnCh, clnRes)
s.log("client running")
- s.log(<- clnRes)
+ s.log(<-clnRes)
err = <-clnCh
s.assertNil(err)
s.log("Test completed")
s.teardownSuite = setupSuite(&s.Suite, "ns")
s.loadContainerTopology("ns")
}
-
time.Sleep(1 * time.Second)
s.teardownSuite = setupSuite(&s.Suite, "tap")
}
-
s.teardownSuite = setupSuite(&s.Suite, "2peerVeth")
s.loadContainerTopology("2peerVeth")
}
-
type ContainerConfig map[string]interface{}
type YamlTopology struct {
- Devices []NetDevConfig `yaml:"devices"`
+ Devices []NetDevConfig `yaml:"devices"`
Containers []ContainerConfig `yaml:"containers"`
- Volumes []string `yaml:"volumes"`
+ Volumes []string `yaml:"volumes"`
}
func AddAddress(device, address, ns string) error {
echoSrvContainer := s.getContainerByName("server-application")
// run server app
- _, err = echoSrvContainer.execAction("RunEchoServer "+proto)
+ _, err = echoSrvContainer.execAction("RunEchoServer " + proto)
s.assertNil(err)
echoClnContainer := s.getContainerByName("client-application")
- o, err := echoClnContainer.execAction("RunEchoClient "+proto)
+ o, err := echoClnContainer.execAction("RunEchoClient " + proto)
s.assertNil(err)
s.log(o)
s.assertNil(err)
echoSrvContainer := s.getContainerByName("server-application")
- _, err = echoSrvContainer.execAction("RunVclEchoServer "+proto)
+ _, err = echoSrvContainer.execAction("RunVclEchoServer " + proto)
s.assertNil(err)
s.log("This whole test case can take around 3 minutes to run. Please be patient.")
s.log("... Running first echo client test, before disconnect.")
echoClnContainer := s.getContainerByName("client-application")
- _, err = echoClnContainer.execAction("RunVclEchoClient "+proto)
+ _, err = echoClnContainer.execAction("RunVclEchoClient " + proto)
s.assertNil(err)
s.log("... First test ended. Stopping VPP server now.")
time.Sleep(30 * time.Second) // Wait a moment for the re-attachment to happen
s.log("... Running second echo client test, after disconnect and re-attachment.")
- _, err = echoClnContainer.execAction("RunVclEchoClient "+proto)
+ _, err = echoClnContainer.execAction("RunVclEchoClient " + proto)
s.assertNil(err)
s.log("Done.")
}
package main
import (
- "fmt"
"encoding/json"
+ "fmt"
"github.com/edwarnicke/exechelper"
)
)
type VppInstance struct {
- container *Container
- config VppConfig
+ container *Container
+ config VppConfig
actionFuncName string
}
type VppConfig struct {
- Variant string
+ Variant string
CliSocketFilePath string
}