本文整理汇总了Golang中github.com/coreos/mantle/platform.TestCluster.RunNative方法的典型用法代码示例。如果您正苦于以下问题:Golang TestCluster.RunNative方法的具体用法?Golang TestCluster.RunNative怎么用?Golang TestCluster.RunNative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/coreos/mantle/platform.TestCluster
的用法示例。
在下文中一共展示了TestCluster.RunNative方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ClusterTests
// run clustering based tests
func ClusterTests(c platform.TestCluster) error {
if plog.LevelAt(capnslog.DEBUG) {
// get journalctl -f from all machines before starting
for _, m := range c.Machines() {
if err := platform.StreamJournal(m); err != nil {
return fmt.Errorf("failed to start journal: %v", err)
}
}
}
// wait for etcd to come up
if err := etcd.GetClusterHealth(c.Machines()[0], len(c.Machines())); err != nil {
return err
}
tests := c.ListNativeFunctions()
for _, name := range tests {
plog.Noticef("running %v...", name)
err := c.RunNative(name, c.Machines()[0])
if err != nil {
return err
}
}
return nil
}
示例2: InternetTests
// run internet based tests
func InternetTests(c platform.TestCluster) error {
tests := c.ListNativeFunctions()
for _, name := range tests {
plog.Noticef("running %v...", name)
err := c.RunNative(name, c.Machines()[0])
if err != nil {
return err
}
}
return nil
}
示例3: ClusterTests
// run clustering based tests
func ClusterTests(c platform.TestCluster) error {
if plog.LevelAt(capnslog.DEBUG) {
// get journalctl -f from all machines before starting
for _, m := range c.Machines() {
if err := platform.StreamJournal(m); err != nil {
return fmt.Errorf("failed to start journal: %v", err)
}
}
}
// make sure etcd is up and running
var keyMap map[string]string
var retryFuncs []func() error
retryFuncs = append(retryFuncs, func() error {
var err error
keyMap, err = etcd.SetKeys(c, 3)
if err != nil {
return err
}
return nil
})
retryFuncs = append(retryFuncs, func() error {
if err := etcd.CheckKeys(c, keyMap, true); err != nil {
return err
}
return nil
})
for _, retry := range retryFuncs {
if err := util.Retry(5, 5*time.Second, retry); err != nil {
return fmt.Errorf("etcd failed health check: %v", err)
}
}
tests := c.ListNativeFunctions()
for _, name := range tests {
plog.Noticef("running %v...", name)
err := c.RunNative(name, c.Machines()[0])
if err != nil {
return err
}
}
return nil
}