diff --git a/debian/.gitignore b/debian/.gitignore index 34fb5c0..e5c120f 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -13,7 +13,6 @@ !/signing_templates/ !/source/ !/templates/ -!/tests/ !/upstream/ # Ignore files generated by gencontrol @@ -26,7 +25,6 @@ /generated.*/ /linux-* /rules.gen -/tests/control !/linux-bpf-dev.* !/linux-cpupower.* !/linux-perf.* diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py index 2f1d82e..7b01e33 100755 --- a/debian/bin/gencontrol.py +++ b/debian/bin/gencontrol.py @@ -86,9 +86,6 @@ class Gencontrol(Base): makeflags['SOURCE_BASENAME'] = vars['source_basename'] makeflags['SOURCE_SUFFIX'] = vars['source_suffix'] - # Prepare to generate debian/tests/control - self.tests_control = list(self.templates.get_tests_control('main.tests-control', vars)) - def do_main_makefile( self, config: ConfigMerged, @@ -441,22 +438,6 @@ linux-signed-{vars['arch']} (@signedtemplate_sourceversion@) {dist}; urgency={ur for package in packages_own: package.build_profiles[0].neg.add('pkg.linux.quick') - tests_control_image = self.templates.get_tests_control('image.tests-control', vars) - for c in tests_control_image: - c.depends.extend( - [i.name for i in packages_image_unsigned] - ) - - tests_control_headers = self.templates.get_tests_control('headers.tests-control', vars) - for c in tests_control_headers: - c.depends.extend( - [i.name for i in packages_headers] + - [i.name for i in packages_image_unsigned] - ) - - self.tests_control.extend(tests_control_image) - self.tests_control.extend(tests_control_headers) - kconfig = [] for c in config.config: for d in self.config_dirs: @@ -522,7 +503,6 @@ linux-signed-{vars['arch']} (@signedtemplate_sourceversion@) {dist}; urgency={ur def write(self) -> None: super().write() - self.write_tests_control() self.write_signed() def write_signed(self) -> None: @@ -549,10 +529,6 @@ linux-signed-{vars['arch']} (@signedtemplate_sourceversion@) {dist}; urgency={ur with bundle.path('files.json').open('w') as f: json.dump({'packages': pkg_sign_entries}, f, indent=2) - def write_tests_control(self) -> None: - with open("debian/tests/control", 'w') as f: - write_deb822(self.tests_control, f) - if __name__ == '__main__': Gencontrol()() diff --git a/debian/lib/python/debian_linux/debian.py b/debian/lib/python/debian_linux/debian.py index d5fd58c..f95cf15 100644 --- a/debian/lib/python/debian_linux/debian.py +++ b/debian/lib/python/debian_linux/debian.py @@ -697,39 +697,3 @@ class BinaryPackage(_BasePackage): deb822_load=lambda v: v.split(), deb822_dump=None, ) - - -@dataclasses.dataclass -class TestsControl: - tests: Optional[str] = field_deb822( - 'Tests', - default=None, - ) - test_command: Optional[str] = field_deb822( - 'Test-Command', - default=None, - ) - architecture: PackageArchitecture = field_deb822( - 'Architecture', - default_factory=PackageArchitecture, - ) - restrictions: Optional[str] = field_deb822( - 'Restrictions', - default=None, - ) - features: Optional[str] = field_deb822( - 'Features', - default=None, - ) - depends: PackageRelation = field_deb822( - 'Depends', - default_factory=PackageRelation, - ) - tests_directory: Optional[str] = field_deb822( - 'Tests-Directory', - default=None, - ) - classes: Optional[str] = field_deb822( - 'Classes', - default=None, - ) diff --git a/debian/lib/python/debian_linux/utils.py b/debian/lib/python/debian_linux/utils.py index 5faf526..58210de 100644 --- a/debian/lib/python/debian_linux/utils.py +++ b/debian/lib/python/debian_linux/utils.py @@ -7,7 +7,7 @@ import typing import jinja2 from .dataclasses_deb822 import read_deb822 -from .debian import SourcePackage, BinaryPackage, TestsControl +from .debian import SourcePackage, BinaryPackage class Templates(object): @@ -77,11 +77,6 @@ class Templates(object): ) -> typing.Iterable[SourcePackage]: return read_deb822(SourcePackage, io.StringIO(self.get(key, context))) - def get_tests_control( - self, key: str, context: dict[str, str] = {}, - ) -> typing.Iterable[TestsControl]: - return read_deb822(TestsControl, io.StringIO(self.get(key, context))) - class TextWrapper(textwrap.TextWrapper): wordsep_re = re.compile( diff --git a/debian/rules b/debian/rules index 05e92d7..bdf861b 100755 --- a/debian/rules +++ b/debian/rules @@ -83,8 +83,7 @@ clean-generated: debian/linux-image-*.preinst \ debian/linux-image-*.prerm \ debian/linux-source.maintscript \ - debian/rules.gen \ - debian/tests/control + debian/rules.gen maintainerclean: clean-generated rm -rf $(filter-out debian .git, $(wildcard * .[^.]*)) diff --git a/debian/templates/headers.tests-control.in b/debian/templates/headers.tests-control.in deleted file mode 100644 index 89648c2..0000000 --- a/debian/templates/headers.tests-control.in +++ /dev/null @@ -1,4 +0,0 @@ -Test-Command: debian/tests/headers-kbuild @abiname@@localversion@ -Architecture: @arch@ -Restrictions: skip-not-installable, superficial -Features: test-name=headers-kbuild@localversion@ diff --git a/debian/templates/image.tests-control.in b/debian/templates/image.tests-control.in deleted file mode 100644 index e69de29..0000000 diff --git a/debian/templates/main.tests-control.in b/debian/templates/main.tests-control.in deleted file mode 100644 index 7b8fca6..0000000 --- a/debian/templates/main.tests-control.in +++ /dev/null @@ -1,3 +0,0 @@ -Test-Command: py.test debian/lib/python -Depends: python3-pytest, python3-jinja2 -Restrictions: superficial diff --git a/debian/tests/headers-kbuild b/debian/tests/headers-kbuild deleted file mode 100755 index 55681de..0000000 --- a/debian/tests/headers-kbuild +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -eu - -KERNEL_RELEASE="$1" - -mkdir "$AUTOPKGTEST_TMP"/foo -cat >"$AUTOPKGTEST_TMP"/foo/foo.c < -#include - -static int __init foo_init(void) -{ - pr_info("foo initialised\n"); - return 0; -} -module_init(foo_init); - -static void __exit foo_exit(void) -{ -} -module_exit(foo_exit); - -MODULE_LICENSE("GPL"); -EOF -cat >"$AUTOPKGTEST_TMP"/foo/Kbuild <&1 -# Next, run the build with stdout sent to the original stdout and -# stderr sent through tee to both the original stdout and a file -make -C /lib/modules/"$KERNEL_RELEASE"/build M="$AUTOPKGTEST_TMP"/foo V=1 \ - 2>&1 1>&3 | tee "$AUTOPKGTEST_TMP"/foo/make.stderr -# Close fd 3 -exec 3>&- -# Check for any stderr output that doesn't match the suppressions -if grep -q -v -E 'Skipping BTF generation .* due to unavailability of vmlinux' "$AUTOPKGTEST_TMP"/foo/make.stderr; then - echo >&2 "E: Unexpected warning/error messages" -fi - -echo "I: Clean" -make -C /lib/modules/"$KERNEL_RELEASE"/build M="$AUTOPKGTEST_TMP"/foo V=1 clean