Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | # |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 7 | from oeqa.runtime.case import OERuntimeTestCase |
| 8 | from oeqa.core.decorator.depends import OETestDepends |
Brad Bishop | 977dc1a | 2019-02-06 16:01:43 -0500 | [diff] [blame] | 9 | from oeqa.runtime.decorator.package import OEHasPackage |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 10 | |
| 11 | from oeqa.runtime.utils.targetbuildproject import TargetBuildProject |
| 12 | |
| 13 | class BuildCpioTest(OERuntimeTestCase): |
| 14 | |
| 15 | @classmethod |
| 16 | def setUpClass(cls): |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 17 | uri = 'https://downloads.yoctoproject.org/mirror/sources/cpio-2.13.tar.gz' |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 18 | cls.project = TargetBuildProject(cls.tc.target, |
| 19 | uri, |
| 20 | dl_dir = cls.tc.td['DL_DIR']) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 21 | |
| 22 | @classmethod |
| 23 | def tearDownClass(cls): |
| 24 | cls.project.clean() |
| 25 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 26 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
Brad Bishop | 977dc1a | 2019-02-06 16:01:43 -0500 | [diff] [blame] | 27 | @OEHasPackage(['gcc']) |
| 28 | @OEHasPackage(['make']) |
| 29 | @OEHasPackage(['autoconf']) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 30 | def test_cpio(self): |
Brad Bishop | 977dc1a | 2019-02-06 16:01:43 -0500 | [diff] [blame] | 31 | self.project.download_archive() |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 32 | self.project.run_configure('--disable-maintainer-mode') |
| 33 | # This sed is needed until |
| 34 | # https://git.savannah.gnu.org/cgit/cpio.git/commit/src/global.c?id=641d3f489cf6238bb916368d4ba0d9325a235afb |
| 35 | # is in a release. |
| 36 | self.project._run(r'sed -i -e "/char \*program_name/d" %s/src/global.c' % self.project.targetdir) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 37 | self.project.run_make() |
| 38 | self.project.run_install() |