Ai
5 Star 6 Fork 4

zstackio/zstack-vyos

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
configure_nic_perf_test.go 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
shixin.ruan 提交于 2024-07-08 14:31 +08:00 . [root]: use openeuler image for vpc
package plugin
import (
"zstack-vyos/utils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = XDescribe("configure_nic_perf_test", func() {
var nicCmd configureNicCmd
It("[PERF]CONFIGURE_NIC : prepare env", func() {
utils.InitLog(utils.GetVyosUtLogDir()+"configure_nic_perf_test.log", false)
SetKeepalivedStatusForUt(KeepAlivedStatus_Master)
utils.SetSkipVyosIptablesForUT(true)
})
Measure("[PERF]CONFIGURE_NIC : test create nic perf by ", func(b Benchmarker) {
runtime := b.Time("runtime", func() {
output := createAndRemoveNicPerfTest(nicCmd, 50)
Expect(output).To(BeNil())
})
Ω(runtime.Seconds()).Should(BeNumerically(">", 0), "configureNic()/removeNicPerfTest() shouldn't take too short.")
}, 1)
It("[PERF]CONFIGURE_NIC : destroy env", func() {
utils.SetSkipVyosIptablesForUT(false)
})
})
func createAndRemoveNicPerfTest(nicCmd configureNicCmd, number int) interface{} {
nicCmd = configureNicCmd{}
nicCmd.Nics = append(nicCmd.Nics, utils.PrivateNicsForUT[0])
for i := 1; i <= number; i++ {
if err := configureNic(&nicCmd); err != nil {
return err
}
if err := removeNic(&nicCmd); err != nil {
return err
}
}
return nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zstackio/zstack-vyos.git
git@gitee.com:zstackio/zstack-vyos.git
zstackio
zstack-vyos
zstack-vyos
master

搜索帮助