How to use decompose_kernel method in autotest

Best Python code snippet using autotest_python

kernelexpand_unittest.py

Source:kernelexpand_unittest.py Github

copy

Full Screen

...27 def tearDown(self):28 self.god.unstub_all()29 def test_decompose_simple(self):30 correct = [[km + 'v2.6/linux-2.6.23.tar.bz2']]31 sample = decompose_kernel('2.6.23')32 self.assertEqual(sample, correct)33 def test_decompose_simple_30(self):34 correct = [[km + 'v3.x/linux-3.0.14.tar.bz2', km + 'v3.x/linux-3.0.14.tar.xz']]35 sample = decompose_kernel('3.0.14')36 self.assertEqual(sample, correct)37 def test_decompose_simple_3X(self):38 correct = [[km + 'v3.x/linux-3.2.1.tar.bz2', km + 'v3.x/linux-3.2.1.tar.xz']]39 sample = decompose_kernel('3.2.1')40 self.assertEqual(sample, correct)41 def test_decompose_nominor_30(self):42 correct = [[km + 'v3.x/linux-3.0.tar.bz2', km + 'v3.x/linux-3.0.tar.xz']]43 sample = decompose_kernel('3.0')44 self.assertEqual(sample, correct)45 def test_decompose_nominor_26_fail(self):46 success = False47 try:48 sample = decompose_kernel('2.6')49 success = True50 except NameError:51 pass52 except Exception, e:53 self.fail('expected NameError, got something else')54 if success:55 self.fail('expected NameError, was successful')56 def test_decompose_testing_26(self):57 correct = km + 'v2.6/testing/linux-2.6.35-rc1.tar.bz2'58 sample = decompose_kernel('2.6.35-rc1')[0][1]59 self.assertEqual(sample, correct)60 def test_decompose_testing_30(self):61 correct = km + 'v3.x/testing/linux-3.2-rc1.tar.bz2'62 sample = decompose_kernel('3.2-rc1')[0][0]63 self.assertEqual(sample, correct)64 def test_decompose_testing_30_fail(self):65 success = False66 try:67 sample = decompose_kernel('3.2.1-rc1')68 success = True69 except NameError:70 pass71 except Exception, e:72 self.fail('expected NameError, got something else')73 if success:74 self.fail('expected NameError, was successful')75 def test_decompose_gitweb(self):76 settings.override_value('CLIENT', 'kernel_gitweb', gw)77 settings.override_value('CLIENT', 'stable_kernel_gitweb', sgw)78 correct = [[km + 'v3.x/linux-3.0.tar.bz2', km + 'v3.x/linux-3.0.tar.xz', gw + ';a=snapshot;h=refs/tags/v3.0;sf=tgz']]79 sample = decompose_kernel('3.0')80 self.assertEqual(sample, correct)81 def test_decompose_sha1(self):82 settings.override_value('CLIENT', 'kernel_gitweb', gw)83 settings.override_value('CLIENT', 'stable_kernel_gitweb', sgw)84 correct = [[gw + ';a=snapshot;h=02f8c6aee8df3cdc935e9bdd4f2d020306035dbe;sf=tgz', sgw + ';a=snapshot;h=02f8c6aee8df3cdc935e9bdd4f2d020306035dbe;sf=tgz']]85 sample = decompose_kernel('02f8c6aee8df3cdc935e9bdd4f2d020306035dbe')86 self.assertEqual(sample, correct)87 def test_decompose_fail(self):88 success = False89 try:90 sample = decompose_kernel('1.0.0.0.0')91 success = True92 except NameError:93 pass94 except Exception, e:95 self.fail('expected NameError, got something else')96 if success:97 self.fail('expected NameError, was successful')98 def test_decompose_rcN(self):99 correct = [100 [km + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',101 km + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2']102 ]103 sample = decompose_kernel('2.6.23-rc1')104 self.assertEqual(sample, correct)105 def test_decompose_mmN(self):106 correct = [107 [km + 'v2.6/linux-2.6.23.tar.bz2'],108 [akpm + '2.6/2.6.23/2.6.23-mm1/2.6.23-mm1.bz2']109 ]110 sample = decompose_kernel('2.6.23-mm1')111 self.assertEqual(sample, correct)112 def test_decompose_gitN(self):113 correct = [114 [km + 'v2.6/linux-2.6.23.tar.bz2'],115 [km + 'v2.6/snapshots/old/patch-2.6.23-git1.bz2',116 km + 'v2.6/snapshots/patch-2.6.23-git1.bz2']117 ]118 sample = decompose_kernel('2.6.23-git1')119 self.assertEqual(sample, correct)120 def test_decompose_rcN_mmN(self):121 correct = [122 [km + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',123 km + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2'],124 [akpm + '2.6/2.6.23-rc1/2.6.23-rc1-mm1/2.6.23-rc1-mm1.bz2']125 ]126 sample = decompose_kernel('2.6.23-rc1-mm1')127 self.assertEqual(sample, correct)128 def test_mirrorA_simple(self):129 correct = [130 [kml + 'v2.6/linux-2.6.23.tar.bz2',131 km + 'v2.6/linux-2.6.23.tar.bz2']132 ]133 sample = decompose_kernel('2.6.23')134 sample = mirror_kernel_components(mirrorA, sample)135 self.assertEqual(sample, correct)136 def test_mirrorA_rcN(self):137 correct = [138 [kml + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',139 kml + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2',140 km + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',141 km + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2']142 ]143 sample = decompose_kernel('2.6.23-rc1')144 sample = mirror_kernel_components(mirrorA, sample)145 self.assertEqual(sample, correct)146 def test_mirrorA_mmN(self):147 correct = [148 [kml + 'v2.6/linux-2.6.23.tar.bz2',149 km + 'v2.6/linux-2.6.23.tar.bz2'],150 [akpml + '2.6/2.6.23/2.6.23-mm1/2.6.23-mm1.bz2',151 kml + 'people/akpm/patches/2.6/2.6.23/2.6.23-mm1/2.6.23-mm1.bz2',152 akpm + '2.6/2.6.23/2.6.23-mm1/2.6.23-mm1.bz2']153 ]154 sample = decompose_kernel('2.6.23-mm1')155 sample = mirror_kernel_components(mirrorA, sample)156 self.assertEqual(sample, correct)157 def test_mirrorA_gitN(self):158 correct = [159 [kml + 'v2.6/linux-2.6.23.tar.bz2',160 km + 'v2.6/linux-2.6.23.tar.bz2'],161 [kml + 'v2.6/snapshots/old/patch-2.6.23-git1.bz2',162 kml + 'v2.6/snapshots/patch-2.6.23-git1.bz2',163 km + 'v2.6/snapshots/old/patch-2.6.23-git1.bz2',164 km + 'v2.6/snapshots/patch-2.6.23-git1.bz2']165 ]166 sample = decompose_kernel('2.6.23-git1')167 sample = mirror_kernel_components(mirrorA, sample)168 self.assertEqual(sample, correct)169 def test_mirrorA_rcN_mmN(self):170 correct = [171 [kml + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',172 kml + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2',173 km + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',174 km + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2'],175 [akpml + '2.6/2.6.23-rc1/2.6.23-rc1-mm1/2.6.23-rc1-mm1.bz2',176 kml + 'people/akpm/patches/2.6/2.6.23-rc1/2.6.23-rc1-mm1/2.6.23-rc1-mm1.bz2',177 akpm + '2.6/2.6.23-rc1/2.6.23-rc1-mm1/2.6.23-rc1-mm1.bz2']178 ]179 sample = decompose_kernel('2.6.23-rc1-mm1')180 sample = mirror_kernel_components(mirrorA, sample)181 self.assertEqual(sample, correct)182if __name__ == '__main__':...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful