diff options
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/locales.py | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/meta/lib/oeqa/selftest/cases/locales.py b/meta/lib/oeqa/selftest/cases/locales.py index 433991abf9..4ca8ffb7aa 100644 --- a/meta/lib/oeqa/selftest/cases/locales.py +++ b/meta/lib/oeqa/selftest/cases/locales.py | |||
| @@ -9,23 +9,17 @@ from oeqa.utils.commands import bitbake, runqemu | |||
| 9 | class LocalesTest(OESelftestTestCase): | 9 | class LocalesTest(OESelftestTestCase): |
| 10 | 10 | ||
| 11 | @OETestTag("runqemu") | 11 | @OETestTag("runqemu") |
| 12 | def test_locales_on(self): | ||
| 13 | """ | ||
| 14 | Summary: Test the locales are generated | ||
| 15 | Expected: 1. Check the locale exist in the locale-archive | ||
| 16 | 2. Check the locale exist for the glibc | ||
| 17 | 3. Check the locale can be generated | ||
| 18 | Product: oe-core | ||
| 19 | Author: Louis Rannou <lrannou@baylibre.com> | ||
| 20 | AutomatedBy: Louis Rannou <lrannou@baylibre.com> | ||
| 21 | """ | ||
| 22 | 12 | ||
| 13 | def run_locales_test(self, binary_enabled): | ||
| 23 | features = [] | 14 | features = [] |
| 24 | features.append('EXTRA_IMAGE_FEATURES = "empty-root-password allow-empty-password allow-root-login"') | 15 | features.append('EXTRA_IMAGE_FEATURES = "empty-root-password allow-empty-password allow-root-login"') |
| 25 | features.append('IMAGE_INSTALL:append = " glibc-utils localedef"') | 16 | features.append('IMAGE_INSTALL:append = " glibc-utils localedef"') |
| 26 | features.append('GLIBC_GENERATE_LOCALES = "en_US.UTF-8 fr_FR.UTF-8"') | 17 | features.append('GLIBC_GENERATE_LOCALES = "en_US.UTF-8 fr_FR.UTF-8"') |
| 27 | features.append('IMAGE_LINGUAS:append = " en-us fr-fr"') | 18 | features.append('IMAGE_LINGUAS:append = " en-us fr-fr"') |
| 28 | features.append('ENABLE_BINARY_LOCALE_GENERATION = "1"') | 19 | if binary_enabled: |
| 20 | features.append('ENABLE_BINARY_LOCALE_GENERATION = "1"') | ||
| 21 | else: | ||
| 22 | features.append('ENABLE_BINARY_LOCALE_GENERATION = "0"') | ||
| 29 | self.write_config("\n".join(features)) | 23 | self.write_config("\n".join(features)) |
| 30 | 24 | ||
| 31 | # Build a core-image-minimal | 25 | # Build a core-image-minimal |
| @@ -43,3 +37,18 @@ class LocalesTest(OESelftestTestCase): | |||
| 43 | # output must includes fr_FR.utf8 | 37 | # output must includes fr_FR.utf8 |
| 44 | self.assertEqual(status, 1, msg='localedef test command failed: output: %s' % output) | 38 | self.assertEqual(status, 1, msg='localedef test command failed: output: %s' % output) |
| 45 | self.assertIn("fr_FR.utf8", output, msg='localedef test failed: output: %s' % output) | 39 | self.assertIn("fr_FR.utf8", output, msg='localedef test failed: output: %s' % output) |
| 40 | |||
| 41 | def test_locales_on(self): | ||
| 42 | """ | ||
| 43 | Summary: Test the locales are generated | ||
| 44 | Expected: 1. Check the locale exist in the locale-archive | ||
| 45 | 2. Check the locale exist for the glibc | ||
| 46 | 3. Check the locale can be generated | ||
| 47 | Product: oe-core | ||
| 48 | Author: Louis Rannou <lrannou@baylibre.com> | ||
| 49 | AutomatedBy: Louis Rannou <lrannou@baylibre.com> | ||
| 50 | """ | ||
| 51 | self.run_locales_test(True) | ||
| 52 | |||
| 53 | def test_locales_off(self): | ||
| 54 | self.run_locales_test(False) | ||
