本文整理汇总了Golang中github.com/coreos/fleet/functional/util.RunFleetctl函数的典型用法代码示例。如果您正苦于以下问题:Golang RunFleetctl函数的具体用法?Golang RunFleetctl怎么用?Golang RunFleetctl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RunFleetctl函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestClientHelpFlag
func TestClientHelpFlag(t *testing.T) {
var err error
var fixture, stdout, stderr string
for i, tt := range []string{"--help", "-h", "help", ""} {
if tt == "" {
stdout, stderr, err = util.RunFleetctl()
} else {
stdout, stderr, err = util.RunFleetctl(tt)
}
if err != nil {
t.Fatalf("case %d: failed getting %s output: %v\n\nstdout: %s\n\nstderr: %s", i, tt, err, stdout, stderr)
}
// use the output of the first test case as the point
// of comparison for all future cases
if i == 0 {
if len(stdout) == 0 {
t.Fatalf("case 0: initial case has no help output")
}
fixture = stdout
continue
}
if stdout != fixture {
t.Errorf("case %d: stdout:\n%s\n\ndiffers from stdout of case 0:\n%s", i, stdout, fixture)
}
}
}
示例2: TestClientVersionHelpOutput
func TestClientVersionHelpOutput(t *testing.T) {
stdout, _, err := util.RunFleetctl()
if err != nil {
t.Fatalf("Unexpected error while executing fleetctl: %v", err)
}
if !strings.Contains(stdout, fmt.Sprintf("%s", version.Version)) {
t.Fatalf("Could not find expected version string (%s) in help output:\n%s", version.Version, stdout)
}
}
示例3: TestClientVersionFlag
func TestClientVersionFlag(t *testing.T) {
stdout, _, err := util.RunFleetctl("--version")
if err != nil {
t.Fatalf("Unexpected error while executing fleetctl: %v", err)
}
if strings.TrimSpace(stdout) != fmt.Sprintf("fleetctl version %s", version.Version) {
t.Fatalf("Received unexpected output for `fleetctl --version`: '%s'", stdout)
}
}
示例4: FleetctlWithEnv
func (nc *nspawnCluster) FleetctlWithEnv(m Member, args ...string) (string, string, error) {
handleEndpointFlag(m, true, &args)
return util.RunFleetctl(args...)
}
示例5: Fleetctl
func (nc *nspawnCluster) Fleetctl(args ...string) (string, string, error) {
args = append([]string{"--etcd-key-prefix=" + nc.keyspace()}, args...)
return util.RunFleetctl(args...)
}
示例6: Fleetctl
func (nc *nspawnCluster) Fleetctl(m Member, args ...string) (string, string, error) {
args = append([]string{"--experimental-api", "--endpoint=" + m.Endpoint()}, args...)
return util.RunFleetctl(args...)
}