1
0

drop tests

This commit is contained in:
Konstantin Demin 2024-10-29 05:12:06 +03:00
parent cfb6102755
commit ae7b2275b8
9 changed files with 2 additions and 123 deletions

2
debian/.gitignore vendored
View File

@ -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.*

View File

@ -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()()

View File

@ -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,
)

View File

@ -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(

3
debian/rules vendored
View File

@ -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 * .[^.]*))

View File

@ -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@

View File

@ -1,3 +0,0 @@
Test-Command: py.test debian/lib/python
Depends: python3-pytest, python3-jinja2
Restrictions: superficial

View File

@ -1,46 +0,0 @@
#!/bin/sh -eu
KERNEL_RELEASE="$1"
mkdir "$AUTOPKGTEST_TMP"/foo
cat >"$AUTOPKGTEST_TMP"/foo/foo.c <<EOF
#include <linux/kernel.h>
#include <linux/module.h>
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 <<EOF
obj-m += foo.o
EOF
echo "I: Build for $KERNEL_RELEASE"
# There are some warnings sent to stderr that we need to suppress,
# but any other output to stderr should be treated as a failure.
# We also want all stdout/stderr to appear in order in the log.
# First, duplicate stdout to fd 3
exec 3>&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