Exemple #1
0
*/

var _ = g.Describe("[LocalNode][builds] forcePull should affect pulling builder images", func() {
	defer g.GinkgoRecover()
	var oc = exutil.NewCLI("forcepull", exutil.KubeConfigPath())

	g.BeforeEach(func() {

		g.By("refresh corruptor, prep forcepull builder")
		exutil.PullImage(corruptor, dockerClient.AuthConfiguration{})

		exutil.DumpImage(corruptor)

		// create the image streams and build configs for a test case specific builders
		setupPath := exutil.FixturePath("testdata", "forcepull-setup.json")
		err := exutil.CreateResource(setupPath, oc)

		// kick off the build for the new builder image just for force pull so we can corrupt them without conflicting with
		// any other tests potentially running in parallel
		br, _ := exutil.StartBuildAndWait(oc, bldrPrefix)
		br.AssertSuccess()

		serviceIP, err := oc.Run("get").Args("svc", "docker-registry", "-n", "default", "--config", exutil.KubeConfigPath()).Template("{{.spec.clusterIP}}").Output()
		o.Expect(err).NotTo(o.HaveOccurred())
		port, err := oc.Run("get").Args("svc", "docker-registry", "-n", "default", "--config", exutil.KubeConfigPath()).Template("{{ $x := index .spec.ports 0}}{{$x.port}}").Output()
		o.Expect(err).NotTo(o.HaveOccurred())
		g.By(fmt.Sprintf("docker-registry service IP is %s and port %s ", serviceIP, port))

		// get the auth so we can pull the build image from the internal docker registry since the builder controller will  remove it
		// from the docker daemon cache when the docker build completes;
		authCfg, err = exutil.BuildAuthConfiguration(serviceIP+":"+port, oc)
		o.Expect(err).NotTo(o.HaveOccurred())

		// we have to wait until image stream tag will be available, otherwise
		// `oc start-build` will fail with 'imagestreamtags "wildfly:10.0" not found' error.
		// See this issue for details: https://github.com/openshift/origin/issues/10103
		err = exutil.WaitForAnImageStreamTag(oc, "openshift", "wildfly", "10.0")
		o.Expect(err).NotTo(o.HaveOccurred())
	})

	g.Describe("with scripts from the source repository", func() {
		oc.SetOutputDir(exutil.TestContext.OutputDir)

		g.It("should use assemble-runtime script from the source repository", func() {

			g.By("creating jvm-runner configuration")
			err := exutil.CreateResource(runnerConf, oc)
			o.Expect(err).NotTo(o.HaveOccurred())

			g.By("building jvm-runner image")
			br, _ := exutil.StartBuildAndWait(oc, "jvm-runner")
			br.AssertSuccess()

			g.By("creating build config")
			err = exutil.CreateResource(scriptsFromRepoBc, oc)
			o.Expect(err).NotTo(o.HaveOccurred())

			g.By("running the build")
			br, _ = exutil.StartBuildAndWait(oc, "java-extended-build-from-repo", "--build-loglevel=5")
			br.AssertSuccess()
			buildLog, err := br.Logs()
			if err != nil {