當前位置: 首頁>>代碼示例>>Golang>>正文


Golang util.RunFleetctl函數代碼示例

本文整理匯總了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)
		}
	}
}
開發者ID:artik2015,項目名稱:fleet,代碼行數:29,代碼來源:fleetctl_test.go

示例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)
	}
}
開發者ID:artik2015,項目名稱:fleet,代碼行數:10,代碼來源:fleetctl_test.go

示例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)
	}
}
開發者ID:artik2015,項目名稱:fleet,代碼行數:10,代碼來源:fleetctl_test.go

示例4: FleetctlWithEnv

func (nc *nspawnCluster) FleetctlWithEnv(m Member, args ...string) (string, string, error) {
	handleEndpointFlag(m, true, &args)
	return util.RunFleetctl(args...)
}
開發者ID:jonboulle,項目名稱:fleet,代碼行數:4,代碼來源:nspawn.go

示例5: Fleetctl

func (nc *nspawnCluster) Fleetctl(args ...string) (string, string, error) {
	args = append([]string{"--etcd-key-prefix=" + nc.keyspace()}, args...)
	return util.RunFleetctl(args...)
}
開發者ID:hugoduncan,項目名稱:fleet,代碼行數:4,代碼來源:nspawn.go

示例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...)
}
開發者ID:ericcapricorn,項目名稱:fleet,代碼行數:4,代碼來源:nspawn.go


注:本文中的github.com/coreos/fleet/functional/util.RunFleetctl函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。