Initial Commit
- initial default booting image
This commit is contained in:
0
support/testing/tests/toolchain/__init__.py
Normal file
0
support/testing/tests/toolchain/__init__.py
Normal file
69
support/testing/tests/toolchain/test_aarch64_64k.py
Normal file
69
support/testing/tests/toolchain/test_aarch64_64k.py
Normal file
@@ -0,0 +1,69 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
import infra.basetest
|
||||
|
||||
|
||||
class TestAarch64Pages64kBase(infra.basetest.BRTest):
|
||||
__test__ = False
|
||||
config = \
|
||||
"""
|
||||
BR2_aarch64=y
|
||||
BR2_ARM64_PAGE_SIZE_64K=y
|
||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_18=y
|
||||
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.21"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
|
||||
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
|
||||
BR2_TARGET_ROOTFS_CPIO=y
|
||||
BR2_TARGET_ROOTFS_CPIO_GZIP=y
|
||||
"""
|
||||
|
||||
def login(self):
|
||||
img = os.path.join(self.builddir, "images", "rootfs.cpio.gz")
|
||||
kern = os.path.join(self.builddir, "images", "Image")
|
||||
self.emulator.boot(arch="aarch64",
|
||||
kernel=kern,
|
||||
kernel_cmdline=["console=ttyAMA0"],
|
||||
options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M", "-initrd", img])
|
||||
self.emulator.login()
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
|
||||
cmd = "dmesg | grep 'Dentry cache'"
|
||||
output, exit_code = self.emulator.run(cmd, 120)
|
||||
r = re.match(r".*Dentry cache hash table entries: [0-9]* \(order: ([0-9]*), ([0-9]*) bytes.*", output[0])
|
||||
order = int(r.group(1))
|
||||
size = int(r.group(2))
|
||||
self.assertEqual(2 ** order * 64 * 1024, size)
|
||||
|
||||
|
||||
# gitlab-runner: large
|
||||
class TestAarch64Pages64kGlibc(TestAarch64Pages64kBase):
|
||||
__test__ = True
|
||||
config = TestAarch64Pages64kBase.config + \
|
||||
"""
|
||||
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
|
||||
"""
|
||||
|
||||
|
||||
# gitlab-runner: large
|
||||
class TestAarch64Pages64kuClibc(TestAarch64Pages64kBase):
|
||||
__test__ = True
|
||||
config = TestAarch64Pages64kBase.config + \
|
||||
"""
|
||||
BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y
|
||||
"""
|
||||
|
||||
|
||||
# gitlab-runner: large
|
||||
class TestAarch64Pages64kMusl(TestAarch64Pages64kBase):
|
||||
__test__ = True
|
||||
config = TestAarch64Pages64kBase.config + \
|
||||
"""
|
||||
BR2_TOOLCHAIN_BUILDROOT_MUSL=y
|
||||
"""
|
||||
168
support/testing/tests/toolchain/test_external.py
Normal file
168
support/testing/tests/toolchain/test_external.py
Normal file
@@ -0,0 +1,168 @@
|
||||
import os
|
||||
import infra
|
||||
|
||||
BASIC_CONFIG = \
|
||||
"""
|
||||
BR2_TARGET_ROOTFS_CPIO=y
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
"""
|
||||
|
||||
|
||||
def has_broken_links(path):
|
||||
for root, dirs, files in os.walk(path):
|
||||
for f in files:
|
||||
fpath = os.path.join(root, f)
|
||||
if not os.path.exists(fpath):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
class TestExternalToolchain(infra.basetest.BRTest):
|
||||
def common_check(self):
|
||||
# Check for broken symlinks
|
||||
for d in ["lib", "usr/lib"]:
|
||||
path = os.path.join(self.builddir, "staging", d)
|
||||
self.assertFalse(has_broken_links(path))
|
||||
path = os.path.join(self.builddir, "target", d)
|
||||
self.assertFalse(has_broken_links(path))
|
||||
|
||||
with open(os.path.join(self.builddir, ".config"), 'r') as configf:
|
||||
configlines = [line.strip() for line in configf.readlines()]
|
||||
|
||||
if "BR2_BINFMT_ELF=y" in configlines:
|
||||
interp = infra.get_elf_prog_interpreter(self.builddir,
|
||||
self.toolchain_prefix,
|
||||
"bin/busybox")
|
||||
interp_path = os.path.join(self.builddir, "target", interp[1:])
|
||||
self.assertTrue(os.path.exists(interp_path))
|
||||
|
||||
|
||||
class TestExternalToolchainArmGnu(TestExternalToolchain):
|
||||
config = BASIC_CONFIG + \
|
||||
"""
|
||||
BR2_arm=y
|
||||
BR2_cortex_a8=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_ARM_ARM=y
|
||||
"""
|
||||
toolchain_prefix = "arm-none-linux-gnueabihf"
|
||||
|
||||
def test_run(self):
|
||||
TestExternalToolchain.common_check(self)
|
||||
|
||||
# Check the architecture variant
|
||||
arch = infra.get_file_arch(self.builddir,
|
||||
self.toolchain_prefix,
|
||||
"lib/libc.so.6")
|
||||
self.assertEqual(arch, "v7")
|
||||
isa = infra.get_elf_arch_tag(self.builddir,
|
||||
self.toolchain_prefix,
|
||||
"lib/libc.so.6",
|
||||
"Tag_THUMB_ISA_use")
|
||||
self.assertEqual(isa, "Thumb-2")
|
||||
|
||||
# Boot the system
|
||||
img = os.path.join(self.builddir, "images", "rootfs.cpio")
|
||||
self.emulator.boot(arch="armv7",
|
||||
kernel="builtin",
|
||||
options=["-initrd", img])
|
||||
self.emulator.login()
|
||||
|
||||
|
||||
class TestExternalToolchainBuildrootMusl(TestExternalToolchain):
|
||||
busybox_fragment = \
|
||||
infra.filepath("conf/busybox-for-old-toolchains.cfg")
|
||||
config = BASIC_CONFIG + \
|
||||
f"""
|
||||
BR2_arm=y
|
||||
BR2_cortex_a9=y
|
||||
BR2_ARM_ENABLE_VFP=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2017.05-1078-g95b1dae.tar.bz2"
|
||||
BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_12=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="{busybox_fragment}"
|
||||
"""
|
||||
toolchain_prefix = "arm-linux"
|
||||
|
||||
def test_run(self):
|
||||
TestExternalToolchain.common_check(self)
|
||||
img = os.path.join(self.builddir, "images", "rootfs.cpio")
|
||||
self.emulator.boot(arch="armv7",
|
||||
kernel="builtin",
|
||||
options=["-initrd", img])
|
||||
self.emulator.login()
|
||||
|
||||
|
||||
class TestExternalToolchainCtngMusl(TestExternalToolchain):
|
||||
busybox_fragment = \
|
||||
infra.filepath("conf/busybox-for-old-toolchains.cfg")
|
||||
config = BASIC_CONFIG + \
|
||||
f"""
|
||||
BR2_arm=y
|
||||
BR2_cortex_a9=y
|
||||
BR2_ARM_ENABLE_VFP=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.net/toolchains/tarballs/arm-ctng-linux-musleabihf.tar.xz"
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-ctng-linux-musleabihf"
|
||||
BR2_TOOLCHAIN_EXTERNAL_GCC_7=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="{busybox_fragment}"
|
||||
"""
|
||||
toolchain_prefix = "arm-ctng-linux-musleabihf"
|
||||
|
||||
def test_run(self):
|
||||
TestExternalToolchain.common_check(self)
|
||||
img = os.path.join(self.builddir, "images", "rootfs.cpio")
|
||||
self.emulator.boot(arch="armv7",
|
||||
kernel="builtin",
|
||||
options=["-initrd", img])
|
||||
self.emulator.login()
|
||||
|
||||
|
||||
class TestExternalToolchainBuildrootuClibc(TestExternalToolchain):
|
||||
busybox_fragment = \
|
||||
infra.filepath("conf/busybox-for-old-toolchains.cfg")
|
||||
config = BASIC_CONFIG + \
|
||||
f"""
|
||||
BR2_arm=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2017.05-1078-g95b1dae.tar.bz2"
|
||||
BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
|
||||
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
|
||||
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="{busybox_fragment}"
|
||||
"""
|
||||
toolchain_prefix = "arm-linux"
|
||||
|
||||
def test_run(self):
|
||||
TestExternalToolchain.common_check(self)
|
||||
img = os.path.join(self.builddir, "images", "rootfs.cpio")
|
||||
self.emulator.boot(arch="armv7",
|
||||
kernel="builtin",
|
||||
options=["-initrd", img])
|
||||
self.emulator.login()
|
||||
|
||||
|
||||
class TestExternalToolchainCCache(TestExternalToolchainBuildrootuClibc):
|
||||
extraconfig = \
|
||||
"""
|
||||
BR2_CCACHE=y
|
||||
BR2_CCACHE_DIR="{builddir}/ccache-dir"
|
||||
"""
|
||||
|
||||
def __init__(self, names):
|
||||
super(TestExternalToolchainBuildrootuClibc, self).__init__(names)
|
||||
self.config += self.extraconfig.format(builddir=self.builddir)
|
||||
41
support/testing/tests/toolchain/test_external_arm.py
Normal file
41
support/testing/tests/toolchain/test_external_arm.py
Normal file
@@ -0,0 +1,41 @@
|
||||
from tests.toolchain.test_external import TestExternalToolchain
|
||||
|
||||
|
||||
class TestExternalToolchainArmArm(TestExternalToolchain):
|
||||
config = """
|
||||
BR2_arm=y
|
||||
BR2_cortex_a8=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_ARM_ARM=y
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
"""
|
||||
toolchain_prefix = "arm-none-linux-gnueabihf"
|
||||
|
||||
def test_run(self):
|
||||
TestExternalToolchain.common_check(self)
|
||||
|
||||
|
||||
class TestExternalToolchainArmAarch64(TestExternalToolchain):
|
||||
config = """
|
||||
BR2_aarch64=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64=y
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
"""
|
||||
toolchain_prefix = "aarch64-none-linux-gnu"
|
||||
|
||||
def test_run(self):
|
||||
TestExternalToolchain.common_check(self)
|
||||
|
||||
|
||||
class TestExternalToolchainArmAarch64Be(TestExternalToolchain):
|
||||
config = """
|
||||
BR2_aarch64_be=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_BE=y
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
"""
|
||||
toolchain_prefix = "aarch64_be-none-linux-gnu"
|
||||
|
||||
def test_run(self):
|
||||
TestExternalToolchain.common_check(self)
|
||||
3359
support/testing/tests/toolchain/test_external_bootlin.py
Normal file
3359
support/testing/tests/toolchain/test_external_bootlin.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user