本文整理汇总了Golang中github.com/contiv/systemtests-utils.TestbedNode.RunCommandBackground方法的典型用法代码示例。如果您正苦于以下问题:Golang TestbedNode.RunCommandBackground方法的具体用法?Golang TestbedNode.RunCommandBackground怎么用?Golang TestbedNode.RunCommandBackground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/contiv/systemtests-utils.TestbedNode
的用法示例。
在下文中一共展示了TestbedNode.RunCommandBackground方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: startVolmaster
func startVolmaster(node utils.TestbedNode) error {
log.Infof("Starting the volmaster on %s", node.GetName())
_, err := node.RunCommandBackground("sudo -E nohup `which volmaster` --debug </dev/null &>/tmp/volmaster.log &")
log.Infof("Waiting for volmaster startup")
time.Sleep(10 * time.Millisecond)
return err
}
示例2: StartNetmasterWithFlags
// StartNetmasterWithFlags starts netplugin on specified testbed nodes with specified flags
func StartNetmasterWithFlags(t *testing.T, node stu.TestbedNode, flags map[string]string) {
time.Sleep(5 * time.Second)
var (
cmdStr string
flagsStr string
)
for k, v := range flags {
flagsStr += fmt.Sprintf("%s=%s", k, v)
}
if os.Getenv("CONTIV_TESTBED") == "DIND" {
cmdStr = fmt.Sprintf("netmaster %s 1>/tmp/netmaster.log 2>&1", flagsStr)
} else {
cmdStr = fmt.Sprintf("nohup netmaster %s 0<&- &>/tmp/netmaster.log", flagsStr)
}
output, err := node.RunCommandBackground(cmdStr)
if err != nil {
t.Fatalf("Failed to launch netplugin. Error: %s\nCmd:%q\n Output : %s\n",
err, cmdStr, output)
}
time.Sleep(5 * time.Second)
}
示例3: startVolplugin
func startVolplugin(node utils.TestbedNode) error {
log.Infof("Starting the volplugin on %q", node.GetName())
defer time.Sleep(10 * time.Millisecond)
// FIXME this is hardcoded because it's simpler. If we move to
// multimaster or change the monitor subnet, we will have issues.
_, err := node.RunCommandBackground("sudo -E `which volplugin` --debug &>/tmp/volplugin.log &")
return err
}
示例4: startVolsupervisor
func startVolsupervisor(node utils.TestbedNode) error {
log.Infof("Starting the volsupervisor on %s", node.GetName())
_, err := node.RunCommandBackground("sudo -E nohup `which volsupervisor` --debug </dev/null &>/tmp/volsupervisor.log &")
return err
}
示例5: volpluginStart
func volpluginStart(node utils.TestbedNode) error {
// FIXME this is hardcoded because it's simpler. If we move to
// multimaster or change the monitor subnet, we will have issues.
_, err := node.RunCommandBackground("sudo -E `which volplugin` --debug --master 192.168.24.10:8080 tenant1 &>/tmp/volplugin.log &")
return err
}