Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | # Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | """Image service tests.""" |
| 7 | |
| 8 | from __future__ import print_function |
| 9 | |
| 10 | import os |
| 11 | |
Mike Frysinger | 6db648e | 2018-07-24 19:57:58 -0400 | [diff] [blame] | 12 | import mock |
| 13 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 14 | from chromite.api import api_config |
Alex Klein | 8cb365a | 2019-05-15 16:24:53 -0600 | [diff] [blame] | 15 | from chromite.api import controller |
| 16 | from chromite.api.controller import image as image_controller |
Alex Klein | 7107bdd | 2019-03-14 17:14:31 -0600 | [diff] [blame] | 17 | from chromite.api.gen.chromite.api import image_pb2 |
David Burger | 13e06be | 2019-05-13 20:33:16 -0600 | [diff] [blame] | 18 | from chromite.api.gen.chromiumos import common_pb2 |
Alex Klein | 5635568 | 2019-02-07 10:36:54 -0700 | [diff] [blame] | 19 | from chromite.lib import constants |
Alex Klein | 4f0eb43 | 2019-05-02 13:56:04 -0600 | [diff] [blame] | 20 | from chromite.lib import cros_build_lib |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 21 | from chromite.lib import cros_test_lib |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 22 | from chromite.lib import image_lib |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 23 | from chromite.lib import osutils |
Alex Klein | b7cdbe6 | 2019-02-22 11:41:32 -0700 | [diff] [blame] | 24 | from chromite.service import image as image_service |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 25 | |
| 26 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 27 | class CreateTest(cros_test_lib.MockTempDirTestCase, api_config.ApiConfigMixin): |
Alex Klein | 5635568 | 2019-02-07 10:36:54 -0700 | [diff] [blame] | 28 | """Create image tests.""" |
| 29 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 30 | def setUp(self): |
| 31 | self.response = image_pb2.CreateImageResult() |
| 32 | |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 33 | def _GetRequest(self, board=None, types=None, version=None, builder_path=None, |
| 34 | disable_rootfs_verification=False): |
| 35 | """Helper to build a request instance.""" |
| 36 | return image_pb2.CreateImageRequest( |
| 37 | build_target={'name': board}, |
| 38 | image_types=types, |
| 39 | disable_rootfs_verification=disable_rootfs_verification, |
| 40 | version=version, |
| 41 | builder_path=builder_path, |
| 42 | ) |
| 43 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 44 | def testValidateOnly(self): |
| 45 | """Sanity check that a validate only call does not execute any logic.""" |
| 46 | patch = self.PatchObject(image_service, 'Build') |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 47 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 48 | request = self._GetRequest(board='board') |
| 49 | image_controller.Create(request, self.response, self.validate_only_config) |
| 50 | patch.assert_not_called() |
| 51 | |
Michael Mortensen | 10146cf | 2019-11-19 19:59:22 -0700 | [diff] [blame] | 52 | def testMockCall(self): |
| 53 | """Test that mock call does not execute any logic, returns mocked value.""" |
| 54 | patch = self.PatchObject(image_service, 'Build') |
| 55 | |
| 56 | request = self._GetRequest(board='board') |
| 57 | image_controller.Create(request, self.response, self.mock_call_config) |
| 58 | patch.assert_not_called() |
| 59 | self.assertEqual(self.response.success, True) |
| 60 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 61 | def testNoBoard(self): |
| 62 | """Test no board given fails.""" |
| 63 | request = self._GetRequest() |
Alex Klein | 5635568 | 2019-02-07 10:36:54 -0700 | [diff] [blame] | 64 | |
| 65 | # No board should cause it to fail. |
Alex Klein | 4f0eb43 | 2019-05-02 13:56:04 -0600 | [diff] [blame] | 66 | with self.assertRaises(cros_build_lib.DieSystemExit): |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 67 | image_controller.Create(request, self.response, self.api_config) |
Alex Klein | 5635568 | 2019-02-07 10:36:54 -0700 | [diff] [blame] | 68 | |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 69 | def testNoTypeSpecified(self): |
| 70 | """Test the image type default.""" |
| 71 | request = self._GetRequest(board='board') |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 72 | |
Alex Klein | 1bcd988 | 2019-03-19 13:25:24 -0600 | [diff] [blame] | 73 | # Failed result to avoid the success handling logic. |
| 74 | result = image_service.BuildResult(1, []) |
| 75 | build_patch = self.PatchObject(image_service, 'Build', return_value=result) |
Alex Klein | 5635568 | 2019-02-07 10:36:54 -0700 | [diff] [blame] | 76 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 77 | image_controller.Create(request, self.response, self.api_config) |
Alex Klein | 5635568 | 2019-02-07 10:36:54 -0700 | [diff] [blame] | 78 | build_patch.assert_called_with(images=[constants.IMAGE_TYPE_BASE], |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 79 | board='board', config=mock.ANY) |
Alex Klein | 5635568 | 2019-02-07 10:36:54 -0700 | [diff] [blame] | 80 | |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 81 | def testSingleTypeSpecified(self): |
| 82 | """Test it's properly using a specified type.""" |
| 83 | request = self._GetRequest(board='board', types=[common_pb2.DEV]) |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 84 | |
| 85 | # Failed result to avoid the success handling logic. |
| 86 | result = image_service.BuildResult(1, []) |
| 87 | build_patch = self.PatchObject(image_service, 'Build', return_value=result) |
| 88 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 89 | image_controller.Create(request, self.response, self.api_config) |
Alex Klein | 5635568 | 2019-02-07 10:36:54 -0700 | [diff] [blame] | 90 | build_patch.assert_called_with(images=[constants.IMAGE_TYPE_DEV], |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 91 | board='board', config=mock.ANY) |
Alex Klein | 5635568 | 2019-02-07 10:36:54 -0700 | [diff] [blame] | 92 | |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 93 | def testMultipleAndImpliedTypes(self): |
| 94 | """Test multiple types and implied type handling.""" |
| 95 | # The TEST_VM type should force it to build the test image. |
| 96 | types = [common_pb2.BASE, common_pb2.TEST_VM] |
| 97 | expected_images = [constants.IMAGE_TYPE_BASE, constants.IMAGE_TYPE_TEST] |
| 98 | |
| 99 | request = self._GetRequest(board='board', types=types) |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 100 | |
| 101 | # Failed result to avoid the success handling logic. |
| 102 | result = image_service.BuildResult(1, []) |
| 103 | build_patch = self.PatchObject(image_service, 'Build', return_value=result) |
| 104 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 105 | image_controller.Create(request, self.response, self.api_config) |
Alex Klein | 21b9502 | 2019-05-09 14:14:46 -0600 | [diff] [blame] | 106 | build_patch.assert_called_with(images=expected_images, board='board', |
Alex Klein | 5635568 | 2019-02-07 10:36:54 -0700 | [diff] [blame] | 107 | config=mock.ANY) |
| 108 | |
Alex Klein | 1bcd988 | 2019-03-19 13:25:24 -0600 | [diff] [blame] | 109 | def testFailedPackageHandling(self): |
| 110 | """Test failed packages are populated correctly.""" |
| 111 | result = image_service.BuildResult(1, ['foo/bar', 'cat/pkg']) |
| 112 | expected_packages = [('foo', 'bar'), ('cat', 'pkg')] |
| 113 | self.PatchObject(image_service, 'Build', return_value=result) |
| 114 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 115 | input_proto = self._GetRequest(board='board') |
Alex Klein | 1bcd988 | 2019-03-19 13:25:24 -0600 | [diff] [blame] | 116 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 117 | rc = image_controller.Create(input_proto, self.response, self.api_config) |
| 118 | |
Alex Klein | 8cb365a | 2019-05-15 16:24:53 -0600 | [diff] [blame] | 119 | self.assertEqual(controller.RETURN_CODE_UNSUCCESSFUL_RESPONSE_AVAILABLE, rc) |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 120 | for package in self.response.failed_packages: |
Alex Klein | 1bcd988 | 2019-03-19 13:25:24 -0600 | [diff] [blame] | 121 | self.assertIn((package.category, package.package_name), expected_packages) |
| 122 | |
Alex Klein | 2557b4f | 2019-07-11 14:34:00 -0600 | [diff] [blame] | 123 | def testNoPackagesFailureHandling(self): |
| 124 | """Test failed packages are populated correctly.""" |
| 125 | result = image_service.BuildResult(1, []) |
| 126 | self.PatchObject(image_service, 'Build', return_value=result) |
Alex Klein | b7cdbe6 | 2019-02-22 11:41:32 -0700 | [diff] [blame] | 127 | |
Alex Klein | 2557b4f | 2019-07-11 14:34:00 -0600 | [diff] [blame] | 128 | input_proto = image_pb2.CreateImageRequest() |
| 129 | input_proto.build_target.name = 'board' |
Alex Klein | 2557b4f | 2019-07-11 14:34:00 -0600 | [diff] [blame] | 130 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 131 | rc = image_controller.Create(input_proto, self.response, self.api_config) |
Alex Klein | 2557b4f | 2019-07-11 14:34:00 -0600 | [diff] [blame] | 132 | self.assertTrue(rc) |
| 133 | self.assertNotEqual(controller.RETURN_CODE_UNSUCCESSFUL_RESPONSE_AVAILABLE, |
| 134 | rc) |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 135 | self.assertFalse(self.response.failed_packages) |
Alex Klein | 2557b4f | 2019-07-11 14:34:00 -0600 | [diff] [blame] | 136 | |
| 137 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 138 | class ImageSignerTestTest(cros_test_lib.MockTempDirTestCase, |
| 139 | api_config.ApiConfigMixin): |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 140 | """Image signer test tests.""" |
| 141 | |
| 142 | def setUp(self): |
| 143 | self.image_path = os.path.join(self.tempdir, 'image.bin') |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 144 | self.result_directory = os.path.join(self.tempdir, 'results') |
| 145 | |
| 146 | osutils.SafeMakedirs(self.result_directory) |
| 147 | osutils.Touch(self.image_path) |
| 148 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 149 | def testValidateOnly(self): |
| 150 | """Sanity check that validate-only calls don't execute any logic.""" |
| 151 | patch = self.PatchObject(image_lib, 'SecurityTest', return_value=True) |
| 152 | input_proto = image_pb2.TestImageRequest() |
| 153 | input_proto.image.path = self.image_path |
| 154 | output_proto = image_pb2.TestImageResult() |
| 155 | |
| 156 | image_controller.SignerTest(input_proto, output_proto, |
| 157 | self.validate_only_config) |
| 158 | |
| 159 | patch.assert_not_called() |
| 160 | |
Michael Mortensen | 10146cf | 2019-11-19 19:59:22 -0700 | [diff] [blame] | 161 | def testMockCall(self): |
| 162 | """Test that mock call does not execute any logic, returns mocked value.""" |
| 163 | patch = self.PatchObject(image_lib, 'SecurityTest', return_value=True) |
| 164 | input_proto = image_pb2.TestImageRequest() |
| 165 | input_proto.image.path = self.image_path |
| 166 | output_proto = image_pb2.TestImageResult() |
| 167 | |
| 168 | image_controller.SignerTest(input_proto, output_proto, |
| 169 | self.mock_call_config) |
| 170 | |
| 171 | patch.assert_not_called() |
| 172 | self.assertEqual(output_proto.success, True) |
| 173 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 174 | def testSignerTestNoImage(self): |
| 175 | """Test function argument validation.""" |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 176 | input_proto = image_pb2.TestImageRequest() |
| 177 | output_proto = image_pb2.TestImageResult() |
| 178 | |
| 179 | # Nothing provided. |
| 180 | with self.assertRaises(cros_build_lib.DieSystemExit): |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 181 | image_controller.SignerTest(input_proto, output_proto, self.api_config) |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 182 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 183 | def testSignerTestSuccess(self): |
| 184 | """Test successful call handling.""" |
| 185 | self.PatchObject(image_lib, 'SecurityTest', return_value=True) |
| 186 | input_proto = image_pb2.TestImageRequest() |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 187 | input_proto.image.path = self.image_path |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 188 | output_proto = image_pb2.TestImageResult() |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 189 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 190 | image_controller.SignerTest(input_proto, output_proto, self.api_config) |
| 191 | |
| 192 | def testSignerTestFailure(self): |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 193 | """Test function output tests.""" |
| 194 | input_proto = image_pb2.TestImageRequest() |
| 195 | input_proto.image.path = self.image_path |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 196 | output_proto = image_pb2.TestImageResult() |
| 197 | |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 198 | self.PatchObject(image_lib, 'SecurityTest', return_value=False) |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 199 | image_controller.SignerTest(input_proto, output_proto, self.api_config) |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 200 | self.assertFalse(output_proto.success) |
| 201 | |
Michael Mortensen | c83c995 | 2019-08-05 12:15:12 -0600 | [diff] [blame] | 202 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 203 | class ImageTestTest(cros_test_lib.MockTempDirTestCase, |
| 204 | api_config.ApiConfigMixin): |
Alex Klein | 2557b4f | 2019-07-11 14:34:00 -0600 | [diff] [blame] | 205 | """Image test tests.""" |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 206 | |
| 207 | def setUp(self): |
| 208 | self.image_path = os.path.join(self.tempdir, 'image.bin') |
| 209 | self.board = 'board' |
| 210 | self.result_directory = os.path.join(self.tempdir, 'results') |
| 211 | |
| 212 | osutils.SafeMakedirs(self.result_directory) |
| 213 | osutils.Touch(self.image_path) |
| 214 | |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 215 | def testValidateOnly(self): |
| 216 | """Sanity check that a validate only call does not execute any logic.""" |
| 217 | patch = self.PatchObject(image_service, 'Test') |
| 218 | |
| 219 | input_proto = image_pb2.TestImageRequest() |
| 220 | input_proto.image.path = self.image_path |
| 221 | input_proto.build_target.name = self.board |
| 222 | input_proto.result.directory = self.result_directory |
| 223 | output_proto = image_pb2.TestImageResult() |
| 224 | |
| 225 | image_controller.Test(input_proto, output_proto, self.validate_only_config) |
| 226 | patch.assert_not_called() |
| 227 | |
Michael Mortensen | 10146cf | 2019-11-19 19:59:22 -0700 | [diff] [blame] | 228 | def testMockCall(self): |
| 229 | """Test that mock call does not execute any logic, returns mocked value.""" |
| 230 | patch = self.PatchObject(image_service, 'Test') |
| 231 | |
| 232 | input_proto = image_pb2.TestImageRequest() |
| 233 | input_proto.image.path = self.image_path |
| 234 | input_proto.build_target.name = self.board |
| 235 | input_proto.result.directory = self.result_directory |
| 236 | output_proto = image_pb2.TestImageResult() |
| 237 | |
| 238 | image_controller.Test(input_proto, output_proto, self.mock_call_config) |
| 239 | patch.assert_not_called() |
| 240 | self.assertEqual(output_proto.success, True) |
| 241 | |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 242 | def testTestArgumentValidation(self): |
| 243 | """Test function argument validation tests.""" |
Alex Klein | b7cdbe6 | 2019-02-22 11:41:32 -0700 | [diff] [blame] | 244 | self.PatchObject(image_service, 'Test', return_value=True) |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 245 | input_proto = image_pb2.TestImageRequest() |
| 246 | output_proto = image_pb2.TestImageResult() |
| 247 | |
| 248 | # Nothing provided. |
Alex Klein | 4f0eb43 | 2019-05-02 13:56:04 -0600 | [diff] [blame] | 249 | with self.assertRaises(cros_build_lib.DieSystemExit): |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 250 | image_controller.Test(input_proto, output_proto, self.api_config) |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 251 | |
| 252 | # Just one argument. |
| 253 | input_proto.build_target.name = self.board |
Alex Klein | 4f0eb43 | 2019-05-02 13:56:04 -0600 | [diff] [blame] | 254 | with self.assertRaises(cros_build_lib.DieSystemExit): |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 255 | image_controller.Test(input_proto, output_proto, self.api_config) |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 256 | |
| 257 | # Two arguments provided. |
| 258 | input_proto.result.directory = self.result_directory |
Alex Klein | 4f0eb43 | 2019-05-02 13:56:04 -0600 | [diff] [blame] | 259 | with self.assertRaises(cros_build_lib.DieSystemExit): |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 260 | image_controller.Test(input_proto, output_proto, self.api_config) |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 261 | |
| 262 | # Invalid image path. |
| 263 | input_proto.image.path = '/invalid/image/path' |
Alex Klein | 4f0eb43 | 2019-05-02 13:56:04 -0600 | [diff] [blame] | 264 | with self.assertRaises(cros_build_lib.DieSystemExit): |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 265 | image_controller.Test(input_proto, output_proto, self.api_config) |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 266 | |
| 267 | # All valid arguments. |
| 268 | input_proto.image.path = self.image_path |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 269 | image_controller.Test(input_proto, output_proto, self.api_config) |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 270 | |
| 271 | def testTestOutputHandling(self): |
| 272 | """Test function output tests.""" |
| 273 | input_proto = image_pb2.TestImageRequest() |
| 274 | input_proto.image.path = self.image_path |
| 275 | input_proto.build_target.name = self.board |
| 276 | input_proto.result.directory = self.result_directory |
| 277 | output_proto = image_pb2.TestImageResult() |
| 278 | |
Alex Klein | b7cdbe6 | 2019-02-22 11:41:32 -0700 | [diff] [blame] | 279 | self.PatchObject(image_service, 'Test', return_value=True) |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 280 | image_controller.Test(input_proto, output_proto, self.api_config) |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 281 | self.assertTrue(output_proto.success) |
| 282 | |
Alex Klein | b7cdbe6 | 2019-02-22 11:41:32 -0700 | [diff] [blame] | 283 | self.PatchObject(image_service, 'Test', return_value=False) |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 284 | image_controller.Test(input_proto, output_proto, self.api_config) |
Alex Klein | 2966e30 | 2019-01-17 13:29:38 -0700 | [diff] [blame] | 285 | self.assertFalse(output_proto.success) |