diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index fd9ac42168..47353dadff 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
| @@ -1883,6 +1883,54 @@ class DevtoolUpgradeTests(DevtoolBase): | |||
| 1883 | self.assertNotIn(recipe, result.output) | 1883 | self.assertNotIn(recipe, result.output) |
| 1884 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting') | 1884 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting') |
| 1885 | 1885 | ||
| 1886 | def test_devtool_upgrade_drop_md5sum(self): | ||
| 1887 | # Check preconditions | ||
| 1888 | self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') | ||
| 1889 | self.track_for_cleanup(self.workspacedir) | ||
| 1890 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
| 1891 | # For the moment, we are using a real recipe. | ||
| 1892 | recipe = 'devtool-upgrade-test3' | ||
| 1893 | version = '1.6.0' | ||
| 1894 | oldrecipefile = get_bb_var('FILE', recipe) | ||
| 1895 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | ||
| 1896 | self.track_for_cleanup(tempdir) | ||
| 1897 | # Check upgrade. Code does not check if new PV is older or newer that current PV, so, it may be that | ||
| 1898 | # we are downgrading instead of upgrading. | ||
| 1899 | result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, version)) | ||
| 1900 | # Check new recipe file is present | ||
| 1901 | newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version)) | ||
| 1902 | self.assertExists(newrecipefile, 'Recipe file should exist after upgrade') | ||
| 1903 | # Check recipe got changed as expected | ||
| 1904 | with open(oldrecipefile + '.upgraded', 'r') as f: | ||
| 1905 | desiredlines = f.readlines() | ||
| 1906 | with open(newrecipefile, 'r') as f: | ||
| 1907 | newlines = f.readlines() | ||
| 1908 | self.assertEqual(desiredlines, newlines) | ||
| 1909 | |||
| 1910 | def test_devtool_upgrade_all_checksums(self): | ||
| 1911 | # Check preconditions | ||
| 1912 | self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') | ||
| 1913 | self.track_for_cleanup(self.workspacedir) | ||
| 1914 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
| 1915 | # For the moment, we are using a real recipe. | ||
| 1916 | recipe = 'devtool-upgrade-test4' | ||
| 1917 | version = '1.6.0' | ||
| 1918 | oldrecipefile = get_bb_var('FILE', recipe) | ||
| 1919 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | ||
| 1920 | self.track_for_cleanup(tempdir) | ||
| 1921 | # Check upgrade. Code does not check if new PV is older or newer that current PV, so, it may be that | ||
| 1922 | # we are downgrading instead of upgrading. | ||
| 1923 | result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, version)) | ||
| 1924 | # Check new recipe file is present | ||
| 1925 | newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version)) | ||
| 1926 | self.assertExists(newrecipefile, 'Recipe file should exist after upgrade') | ||
| 1927 | # Check recipe got changed as expected | ||
| 1928 | with open(oldrecipefile + '.upgraded', 'r') as f: | ||
| 1929 | desiredlines = f.readlines() | ||
| 1930 | with open(newrecipefile, 'r') as f: | ||
| 1931 | newlines = f.readlines() | ||
| 1932 | self.assertEqual(desiredlines, newlines) | ||
| 1933 | |||
| 1886 | def test_devtool_layer_plugins(self): | 1934 | def test_devtool_layer_plugins(self): |
| 1887 | """Test that devtool can use plugins from other layers. | 1935 | """Test that devtool can use plugins from other layers. |
| 1888 | 1936 | ||
