Exemplo n.º 1
0
    def testCanaryPrempMismatch(self):
        """Handle the canary payloads and testss."""
        target_build = gspaths.Build(bucket='crt',
                                     channel='canary-channel',
                                     board='auron-yuna',
                                     version='9999.0.0')
        prev_build = gspaths.Build(bucket='crt',
                                   channel='canary-channel',
                                   board='auron-yuna',
                                   version='9756.0.0')

        # Create our images.
        mp_image = self.addSignedImage(target_build)
        test_image = self.addTestImage(target_build)
        _prev_premp_image = self.addSignedImage(prev_build, key='premp')
        prev_test_image = self.addTestImage(prev_build)

        # Run the test.
        paygen = self._GetPaygenBuildInstance(target_build)
        payloads, tests = paygen._DiscoverRequiredPayloads()

        # Define the expected payloads. Test delta from prev, but no signed ones.
        mp_full = gspaths.Payload(tgt_image=mp_image, uri=mock.ANY)
        test_full = gspaths.Payload(tgt_image=test_image, uri=mock.ANY)
        n2n_delta = gspaths.Payload(tgt_image=test_image,
                                    src_image=test_image,
                                    uri=mock.ANY)
        test_delta = gspaths.Payload(tgt_image=test_image,
                                     src_image=prev_test_image,
                                     uri=mock.ANY)

        # Verify the results.
        self.assertItemsEqual(payloads, [
            mp_full,
            test_full,
            n2n_delta,
            test_delta,
        ])

        self.assertItemsEqual(tests, [
            paygen_build_lib.PayloadTest(test_full, 'canary-channel',
                                         '9999.0.0'),
            paygen_build_lib.PayloadTest(n2n_delta),
            paygen_build_lib.PayloadTest(test_delta),
        ])
Exemplo n.º 2
0
    def setUp(self):
        self.maxDiff = None

        self.prev_build = gspaths.Build(bucket='crt',
                                        channel='foo-channel',
                                        board='foo-board',
                                        version='1.0.0')

        self.prev_image = gspaths.Image(key='mp', **self.prev_build)
        self.prev_premp_image = gspaths.Image(key='premp', **self.prev_build)
        self.prev_test_image = gspaths.UnsignedImageArchive(image_type='test',
                                                            **self.prev_build)

        self.target_build = gspaths.Build(bucket='crt',
                                          channel='foo-channel',
                                          board='foo-board',
                                          version='1.2.3')

        # Create an additional 'special' image like NPO that isn't NPO,
        # and keyed with a weird key. It should match none of the filters.
        self.special_image = gspaths.Image(bucket='crt',
                                           channel='foo-channel',
                                           board='foo-board',
                                           version='1.2.3',
                                           key='foo-key',
                                           image_channel='special-channel')

        self.basic_image = gspaths.Image(key='mp-v2', **self.target_build)
        self.premp_image = gspaths.Image(key='premp', **self.target_build)
        self.test_image = gspaths.UnsignedImageArchive(image_type='test',
                                                       **self.target_build)

        self.mp_full_payload = gspaths.Payload(tgt_image=self.basic_image)
        self.test_full_payload = gspaths.Payload(tgt_image=self.test_image)
        self.mp_delta_payload = gspaths.Payload(tgt_image=self.basic_image,
                                                src_image=self.prev_image)
        self.test_delta_payload = gspaths.Payload(
            tgt_image=self.test_image, src_image=self.prev_test_image)

        self.full_payload_test = paygen_build_lib.PayloadTest(
            self.test_full_payload, self.target_build.channel,
            self.target_build.version)
        self.delta_payload_test = paygen_build_lib.PayloadTest(
            self.test_delta_payload)
Exemplo n.º 3
0
    def testStable(self):
        """Handle the canary payloads and testss."""
        target_build = gspaths.Build(bucket='crt',
                                     channel='stable-channel',
                                     board='auron-yuna',
                                     version='9999.0.0')
        build_8530 = gspaths.Build(bucket='crt',
                                   channel='stable-channel',
                                   board='auron-yuna',
                                   version='8530.96.0')
        build_8743 = gspaths.Build(bucket='crt',
                                   channel='stable-channel',
                                   board='auron-yuna',
                                   version='8743.85.0')
        build_8872 = gspaths.Build(bucket='crt',
                                   channel='stable-channel',
                                   board='auron-yuna',
                                   version='8872.76.0')
        build_9000 = gspaths.Build(bucket='crt',
                                   channel='stable-channel',
                                   board='auron-yuna',
                                   version='9000.91.0')
        build_9202 = gspaths.Build(bucket='crt',
                                   channel='stable-channel',
                                   board='auron-yuna',
                                   version='9202.64.0')
        build_9334 = gspaths.Build(bucket='crt',
                                   channel='stable-channel',
                                   board='auron-yuna',
                                   version='9334.72.0')
        build_9460 = gspaths.Build(bucket='crt',
                                   channel='stable-channel',
                                   board='auron-yuna',
                                   version='9460.60.0')
        build_9460_67 = gspaths.Build(bucket='crt',
                                      channel='stable-channel',
                                      board='auron-yuna',
                                      version='9460.67.0')

        # Create our images, ignore FSI 6457.83.0, 7390.68.0
        mp_image = self.addSignedImage(target_build)
        test_image = self.addTestImage(target_build)

        image_8530 = self.addSignedImage(build_8530)
        test_image_8530 = self.addTestImage(build_8530)

        image_8743 = self.addSignedImage(build_8743)
        test_image_8743 = self.addTestImage(build_8743)

        image_8872 = self.addSignedImage(build_8872)
        test_image_8872 = self.addTestImage(build_8872)

        image_9000 = self.addSignedImage(build_9000)
        test_image_9000 = self.addTestImage(build_9000)

        image_9202 = self.addSignedImage(build_9202)
        test_image_9202 = self.addTestImage(build_9202)

        image_9334 = self.addSignedImage(build_9334)
        test_image_9334 = self.addTestImage(build_9334)

        image_9460 = self.addSignedImage(build_9460)
        test_image_9460 = self.addTestImage(build_9460)

        image_9460_67 = self.addSignedImage(build_9460_67)
        test_image_9460_67 = self.addTestImage(build_9460_67)

        # Run the test.
        paygen = self._GetPaygenBuildInstance(target_build)
        payloads, tests = paygen._DiscoverRequiredPayloads()

        # Define the expected payloads. Test delta from prev, but no signed ones.
        mp_full = gspaths.Payload(tgt_image=mp_image, uri=mock.ANY)
        test_full = gspaths.Payload(tgt_image=test_image, uri=mock.ANY)
        n2n_delta = gspaths.Payload(tgt_image=test_image,
                                    src_image=test_image,
                                    uri=mock.ANY)

        mp_delta_8530 = gspaths.Payload(tgt_image=mp_image,
                                        src_image=image_8530,
                                        uri=mock.ANY)
        test_delta_8530 = gspaths.Payload(tgt_image=test_image,
                                          src_image=test_image_8530,
                                          uri=mock.ANY)
        mp_delta_8743 = gspaths.Payload(tgt_image=mp_image,
                                        src_image=image_8743,
                                        uri=mock.ANY)
        test_delta_8743 = gspaths.Payload(tgt_image=test_image,
                                          src_image=test_image_8743,
                                          uri=mock.ANY)
        mp_delta_8872 = gspaths.Payload(tgt_image=mp_image,
                                        src_image=image_8872,
                                        uri=mock.ANY)
        test_delta_8872 = gspaths.Payload(tgt_image=test_image,
                                          src_image=test_image_8872,
                                          uri=mock.ANY)
        mp_delta_9000 = gspaths.Payload(tgt_image=mp_image,
                                        src_image=image_9000,
                                        uri=mock.ANY)
        test_delta_9000 = gspaths.Payload(tgt_image=test_image,
                                          src_image=test_image_9000,
                                          uri=mock.ANY)
        mp_delta_9202 = gspaths.Payload(tgt_image=mp_image,
                                        src_image=image_9202,
                                        uri=mock.ANY)
        test_delta_9202 = gspaths.Payload(tgt_image=test_image,
                                          src_image=test_image_9202,
                                          uri=mock.ANY)
        mp_delta_9334 = gspaths.Payload(tgt_image=mp_image,
                                        src_image=image_9334,
                                        uri=mock.ANY)
        test_delta_9334 = gspaths.Payload(tgt_image=test_image,
                                          src_image=test_image_9334,
                                          uri=mock.ANY)
        mp_delta_9460 = gspaths.Payload(tgt_image=mp_image,
                                        src_image=image_9460,
                                        uri=mock.ANY)
        test_delta_9460 = gspaths.Payload(tgt_image=test_image,
                                          src_image=test_image_9460,
                                          uri=mock.ANY)
        mp_delta_9460_67 = gspaths.Payload(tgt_image=mp_image,
                                           src_image=image_9460_67,
                                           uri=mock.ANY)
        test_delta_9460_67 = gspaths.Payload(tgt_image=test_image,
                                             src_image=test_image_9460_67,
                                             uri=mock.ANY)

        # Verify the results.
        self.assertItemsEqual(payloads, [
            mp_full,
            test_full,
            n2n_delta,
            mp_delta_8530,
            test_delta_8530,
            mp_delta_8743,
            test_delta_8743,
            mp_delta_8872,
            test_delta_8872,
            mp_delta_9000,
            test_delta_9000,
            mp_delta_9202,
            test_delta_9202,
            mp_delta_9334,
            test_delta_9334,
            mp_delta_9460,
            test_delta_9460,
            mp_delta_9460_67,
            test_delta_9460_67,
        ])

        self.assertItemsEqual(
            tests,
            [
                paygen_build_lib.PayloadTest(test_full, 'stable-channel',
                                             '9999.0.0'),
                paygen_build_lib.PayloadTest(test_full, 'stable-channel',
                                             '8530.96.0'),
                paygen_build_lib.PayloadTest(n2n_delta),
                paygen_build_lib.PayloadTest(test_delta_8530),
                paygen_build_lib.PayloadTest(test_delta_8743),
                paygen_build_lib.PayloadTest(test_delta_8872),
                paygen_build_lib.PayloadTest(test_delta_9000),
                paygen_build_lib.PayloadTest(test_delta_9202),
                paygen_build_lib.PayloadTest(test_delta_9334),
                paygen_build_lib.PayloadTest(test_delta_9460),
                # test_image_9460_67 had test turned off in json.
            ])
Exemplo n.º 4
0
    def testCanaryEverything(self):
        """Handle the canary payloads and tests."""
        # Make our random strings deterministic for testing.
        self.PatchObject(gspaths, '_RandomString', return_value='<random>')

        target_build = gspaths.Build(bucket='crt',
                                     channel='canary-channel',
                                     board='auron-yuna',
                                     version='9999.0.0')
        prev_build = gspaths.Build(bucket='crt',
                                   channel='canary-channel',
                                   board='auron-yuna',
                                   version='9756.0.0')

        # Create our images.
        premp_image = self.addSignedImage(target_build, key='premp')
        mp_image = self.addSignedImage(target_build)
        test_image = self.addTestImage(target_build)
        prev_premp_image = self.addSignedImage(prev_build, key='premp')
        prev_mp_image = self.addSignedImage(prev_build)
        prev_test_image = self.addTestImage(prev_build)

        # Run the test.
        paygen = self._GetPaygenBuildInstance(target_build)
        payloads, tests = paygen._DiscoverRequiredPayloads()

        # pylint: disable=line-too-long
        # Define the expected payloads, including URLs.
        mp_full = gspaths.Payload(
            tgt_image=mp_image,
            uri=
            'gs://crt/canary-channel/auron-yuna/9999.0.0/payloads/chromeos_9999.0.0_auron-yuna_canary-channel_full_mp.bin-<random>.signed'
        )
        premp_full = gspaths.Payload(
            tgt_image=premp_image,
            uri=
            'gs://crt/canary-channel/auron-yuna/9999.0.0/payloads/chromeos_9999.0.0_auron-yuna_canary-channel_full_premp.bin-<random>.signed'
        )
        test_full = gspaths.Payload(
            tgt_image=test_image,
            uri=
            'gs://crt/canary-channel/auron-yuna/9999.0.0/payloads/chromeos_9999.0.0_auron-yuna_canary-channel_full_test.bin-<random>'
        )
        n2n_delta = gspaths.Payload(
            tgt_image=test_image,
            src_image=test_image,
            uri=
            'gs://crt/canary-channel/auron-yuna/9999.0.0/payloads/chromeos_9999.0.0-9999.0.0_auron-yuna_canary-channel_delta_test.bin-<random>'
        )
        mp_delta = gspaths.Payload(
            tgt_image=mp_image,
            src_image=prev_mp_image,
            uri=
            'gs://crt/canary-channel/auron-yuna/9999.0.0/payloads/chromeos_9756.0.0-9999.0.0_auron-yuna_canary-channel_delta_mp.bin-<random>.signed'
        )
        premp_delta = gspaths.Payload(
            tgt_image=premp_image,
            src_image=prev_premp_image,
            uri=
            'gs://crt/canary-channel/auron-yuna/9999.0.0/payloads/chromeos_9756.0.0-9999.0.0_auron-yuna_canary-channel_delta_premp.bin-<random>.signed'
        )
        test_delta = gspaths.Payload(
            tgt_image=test_image,
            src_image=prev_test_image,
            uri=
            'gs://crt/canary-channel/auron-yuna/9999.0.0/payloads/chromeos_9756.0.0-9999.0.0_auron-yuna_canary-channel_delta_test.bin-<random>'
        )

        # Verify the results.
        self.assertItemsEqual(payloads, [
            mp_full,
            premp_full,
            test_full,
            n2n_delta,
            mp_delta,
            premp_delta,
            test_delta,
        ])

        self.assertItemsEqual(tests, [
            paygen_build_lib.PayloadTest(test_full, 'canary-channel',
                                         '9999.0.0'),
            paygen_build_lib.PayloadTest(n2n_delta),
            paygen_build_lib.PayloadTest(test_delta),
        ])