当前位置: 首页>>代码示例>>Golang>>正文


Golang I3SClient.CreateArtifactsBundle方法代码示例

本文整理汇总了Golang中github.com/HewlettPackard/oneview-golang/i3s.I3SClient.CreateArtifactsBundle方法的典型用法代码示例。如果您正苦于以下问题:Golang I3SClient.CreateArtifactsBundle方法的具体用法?Golang I3SClient.CreateArtifactsBundle怎么用?Golang I3SClient.CreateArtifactsBundle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/HewlettPackard/oneview-golang/i3s.I3SClient的用法示例。


在下文中一共展示了I3SClient.CreateArtifactsBundle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: TestCreateArtifactsBundle

func TestCreateArtifactsBundle(t *testing.T) {
	var (
		d        *I3STest
		c        *i3s.I3SClient
		testName string
	)
	if os.Getenv("I3S_TEST_ACCEPTANCE") == "true" {
		d, c = getTestDriverA("test_artifacts_bundle")
		if c == nil {
			t.Fatalf("Failed to execute getTestDriver() ")
		}
		// find out if the test artifactsBundle already exist
		testName = d.Tc.GetTestData(d.Env, "Name").(string)

		testArtifactsBundle, err := c.GetArtifactsBundleByName(testName)
		assert.NoError(t, err, "CreateArtifactsBundle get the ArtifactsBundle error -> %s", err)

		if testArtifactsBundle.URI.IsNil() {
			testInputArtifactsBundle := i3s.InputArtifactsBundle{
				Name: testName,
			}
			err := c.CreateArtifactsBundle(testInputArtifactsBundle)
			assert.NoError(t, err, "CreateArtifactsBundle error -> %s", err)

			err = c.CreateArtifactsBundle(testInputArtifactsBundle)
			assert.Error(t, err, "CreateArtifactsBundle should error because the ArtifactsBundle already exists, err-> %s", err)

		} else {
			log.Warnf("The ArtifactsBundle already exist, so skipping CreateArtifactsBundle test for %s", testName)
		}

		// reload the test artifact bundle that we just created
		testArtifactsBundle, err = c.GetArtifactsBundleByName(testName)
		assert.NoError(t, err, "GetArtifactsBundle error -> %s", err)
	}
}
开发者ID:HewlettPackard,项目名称:oneview-golang,代码行数:36,代码来源:artifacts_bundle_test.go


注:本文中的github.com/HewlettPackard/oneview-golang/i3s.I3SClient.CreateArtifactsBundle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。