• Home
  • Raw
  • Download

Lines Matching refs:self

33   def setUp(self):  argument
34 self.testdata_dir = test_utils.get_testdata_dir()
36 self.payload_key = os.path.join(self.testdata_dir, 'testkey.key')
37 self.apex_with_apk = os.path.join(self.testdata_dir, 'has_apk.apex')
49 def test_ParseApexPayloadInfo(self): argument
50 payload_file = self._GetTestPayload()
52 'avbtool', payload_file, self.payload_key, 'testkey', 'SHA256_RSA2048',
53 self.SALT, 'sha256', no_hashtree=True)
55 self.assertEqual('SHA256_RSA2048', payload_info['Algorithm'])
56 self.assertEqual(self.SALT, payload_info['Salt'])
57 self.assertEqual('testkey', payload_info['apex.key'])
58 self.assertEqual('sha256', payload_info['Hash Algorithm'])
59 self.assertEqual('0 bytes', payload_info['Tree Size'])
62 def test_SignApexPayload(self): argument
63 payload_file = self._GetTestPayload()
65 'avbtool', payload_file, self.payload_key, 'testkey', 'SHA256_RSA2048',
66 self.SALT, 'sha256', no_hashtree=True)
68 'avbtool', payload_file, self.payload_key, True)
71 def test_SignApexPayload_withHashtree(self): argument
72 payload_file = self._GetTestPayload()
74 'avbtool', payload_file, self.payload_key, 'testkey', 'SHA256_RSA2048',
75 self.SALT, 'sha256', no_hashtree=False)
76 apex_utils.VerifyApexPayload('avbtool', payload_file, self.payload_key)
78 self.assertEqual('4096 bytes', payload_info['Tree Size'])
81 def test_SignApexPayload_noHashtree(self): argument
82 payload_file = self._GetTestPayload()
84 'avbtool', payload_file, self.payload_key, 'testkey', 'SHA256_RSA2048',
85 self.SALT, 'sha256', no_hashtree=True)
86 apex_utils.VerifyApexPayload('avbtool', payload_file, self.payload_key,
89 self.assertEqual('0 bytes', payload_info['Tree Size'])
92 def test_SignApexPayload_withSignerHelper(self): argument
93 payload_file = self._GetTestPayload()
94 signing_helper = os.path.join(self.testdata_dir, 'signing_helper.sh')
101 self.payload_key,
102 'testkey', 'SHA256_RSA2048', self.SALT, 'sha256',
106 'avbtool', payload_file, self.payload_key, True)
109 def test_SignApexPayload_invalidKey(self): argument
110 self.assertRaises(
114 self._GetTestPayload(),
115 os.path.join(self.testdata_dir, 'testkey.x509.pem'),
118 self.SALT,
123 def test_VerifyApexPayload_wrongKey(self): argument
124 payload_file = self._GetTestPayload()
126 'avbtool', payload_file, self.payload_key, 'testkey', 'SHA256_RSA2048',
127 self.SALT, 'sha256', True)
129 'avbtool', payload_file, self.payload_key, True)
130 self.assertRaises(
135 os.path.join(self.testdata_dir, 'testkey_with_passwd.key'),
139 def test_ApexApkSigner_noApkPresent(self): argument
140 apex_path = os.path.join(self.testdata_dir, 'foo.apex')
142 processed_apex = signer.ProcessApexFile({}, self.payload_key)
143 self.assertEqual(apex_path, processed_apex)
146 def test_ApexApkSigner_apkKeyNotPresent(self): argument
148 shutil.copy(self.apex_with_apk, apex_path)
150 self.assertRaises(apex_utils.ApexSigningError, signer.ProcessApexFile,
151 {}, self.payload_key)
154 def test_ApexApkSigner_signApk(self): argument
156 shutil.copy(self.apex_with_apk, apex_path)
159 self.testdata_dir, 'testkey')}
161 self.payload_key = os.path.join(self.testdata_dir, 'testkey_RSA4096.key')
162 apex_file = signer.ProcessApexFile(apk_keys, self.payload_key)
172 self.assertEquals('com.google.android.wifi', package_name)
175 def test_ApexApkSigner_noAssetDir(self): argument
178 with zipfile.ZipFile(self.apex_with_apk, 'r', allowZip64=True) as input_zip:
186 self.testdata_dir, 'testkey')}
188 self.payload_key = os.path.join(self.testdata_dir, 'testkey_RSA4096.key')
189 signer.ProcessApexFile(apk_keys, self.payload_key)