Example #1
0
 def setUp(self):
     self.rc.SetDefaultCmdResult()
     self.image = image_lib_unittest.LoopbackPartitionsMock(
         'outfile', self.tempdir)
     self.PatchObject(image_lib,
                      'LoopbackPartitions',
                      return_value=self.image)
Example #2
0
 def setUp(self):
     self.rc.SetDefaultCmdResult()
     self.rc.AddCmdResult(partial_mock.InOrder(
         ['dump_kernel_config', '/dev/loop9999p2']),
                          output=SAMPLE_KERNEL_CONFIG)
     self.image = image_lib_unittest.LoopbackPartitionsMock(
         'outfile', self.tempdir)
Example #3
0
 def setUp(self):
     self.rc.SetDefaultCmdResult()
     self.expected_sha1sum = '5' * 40
     self.rc.AddCmdResult(partial_mock.In('sha1sum'),
                          output=self.expected_sha1sum + '  meh')
     self.loginfo = self.PatchObject(logging, 'info')
     self.keytempdir = osutils.TempDir()
     self.keyset = keys.Keyset(self.keytempdir.tempdir)
     self.image = image_lib_unittest.LoopbackPartitionsMock(
         'outfile', self.tempdir)
     self.ukc = self.PatchObject(imagefile, '_UpdateKernelConfig')
Example #4
0
 def setUp(self):
     self.keytempdir = osutils.TempDir()
     self.keyset = keys.Keyset(self.keytempdir.tempdir)
     self.info_mock = self.PatchObject(logging, 'info')
     self.warn_mock = self.PatchObject(logging, 'warning')
     self.rc.SetDefaultCmdResult()
     self.image = image_lib_unittest.LoopbackPartitionsMock(
         'meh', self.tempdir)
     self.PatchObject(imagefile,
                      '_PathForVbootSigningScripts',
                      return_value={'PATH': 'path'})
Example #5
0
 def testSimple(self):
     """Test the normal case."""
     image = image_lib_unittest.LoopbackPartitionsMock('outfile')
     self.PatchObject(image_lib, 'LoopbackPartitions', return_value=image)
     gkc = self.PatchObject(imagefile,
                            'GetKernelConfig',
                            return_value='Config')
     imagefile.DumpConfig('image.bin')
     expected = [
         mock.call('/dev/loop9999p2', check=False),
         mock.call('/dev/loop9999p4', check=False),
     ]
     self.assertEqual(expected, gkc.call_args_list)
Example #6
0
 def setUp(self):
     self.rc.SetDefaultCmdResult()
     self.rc.AddCmdResult(partial_mock.InOrder(
         ['dump_kernel_config', '/dev/loop9999p2']),
                          output=SAMPLE_KERNEL_CONFIG)
     self.keytempdir = osutils.TempDir()
     self.keyset = keys.Keyset(self.keytempdir.tempdir)
     self.image = image_lib_unittest.LoopbackPartitionsMock(
         'outfile', self.tempdir)
     self.root_hash = CalculateRootfsHashMock('meh', SAMPLE_KERNEL_CONFIG)
     self.PatchObject(imagefile,
                      'CalculateRootfsHash',
                      return_value=self.root_hash)
     self.rc.AddCmdResult(partial_mock.In('tune2fs'),
                          output='Block count: 4480\n')
     self.ukc = self.PatchObject(imagefile, '_UpdateKernelConfig')
Example #7
0
 def setUp(self):
     self.rc.SetDefaultCmdResult()
     self.image = image_lib_unittest.LoopbackPartitionsMock(
         'outfile', self.tempdir)
     self.PatchObject(image_lib,
                      'LoopbackPartitions',
                      return_value=self.image)
     self.fw_mock = self.PatchObject(firmware, 'ResignImageFirmware')
     self.android_mock = self.PatchObject(imagefile, 'SignAndroidImage')
     self.uefi_mock = self.PatchObject(imagefile, 'SignUefiBinaries')
     self.PatchObject(imagefile, 'UpdateRootfsHash', return_value=True)
     self.PatchObject(imagefile, 'UpdateStatefulPartitionVblock')
     self.PatchObject(imagefile,
                      'UpdateRecoveryKernelHash',
                      return_value=True)
     self.PatchObject(imagefile,
                      'UpdateLegacyBootloader',
                      return_value=True)
     self.PatchObject(imagefile,
                      '_PathForVbootSigningScripts',
                      return_value={'PATH': 'path'})
Example #8
0
 def setUp(self):
     self.image = image_lib_unittest.LoopbackPartitionsMock(
         'outfile', self.tempdir)