Buildroot 2018-11 (#258)
* Update to buildroot 2018.11 * containerd update * runc update * runc docker engine * runc docker proxy * update rpi firmware * update network manager * update dhcpd * update wait on network * update rpi wifi * revert glibc
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
CONFIG_F2FS_FS=y
|
||||
CONFIG_F2FS_STAT_FS=y
|
||||
CONFIG_F2FS_FS_XATTR=y
|
||||
CONFIG_F2FS_FS_POSIX_ACL=y
|
||||
CONFIG_F2FS_FS_SECURITY=y
|
||||
@@ -34,17 +34,17 @@ def download(dldir, filename):
|
||||
os.makedirs(dldir)
|
||||
|
||||
tmpfile = tempfile.mktemp(dir=dldir)
|
||||
print "Downloading to {}".format(tmpfile)
|
||||
print("Downloading to {}".format(tmpfile))
|
||||
|
||||
try:
|
||||
url_fh = urlopen(os.path.join(ARTIFACTS_URL, filename))
|
||||
with open(tmpfile, "w+") as tmpfile_fh:
|
||||
tmpfile_fh.write(url_fh.read())
|
||||
except (HTTPError, URLError), err:
|
||||
except (HTTPError, URLError) as err:
|
||||
os.unlink(tmpfile)
|
||||
raise err
|
||||
|
||||
print "Renaming from %s to %s" % (tmpfile, finalpath)
|
||||
print("Renaming from {} to {}".format(tmpfile, finalpath))
|
||||
os.rename(tmpfile, finalpath)
|
||||
return finalpath
|
||||
|
||||
|
||||
@@ -46,8 +46,8 @@ class BRTest(unittest.TestCase):
|
||||
self.config += "\nBR2_JLEVEL={}\n".format(self.jlevel)
|
||||
|
||||
def show_msg(self, msg):
|
||||
print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
|
||||
self.testname, msg)
|
||||
print("{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
|
||||
self.testname, msg))
|
||||
|
||||
def setUp(self):
|
||||
self.show_msg("Starting")
|
||||
|
||||
@@ -35,6 +35,11 @@ class Builder(object):
|
||||
|
||||
def build(self):
|
||||
env = {"PATH": os.environ["PATH"]}
|
||||
if "http_proxy" in os.environ:
|
||||
self.logfile.write("Using system proxy: " +
|
||||
os.environ["http_proxy"] + "\n")
|
||||
env['http_proxy'] = os.environ["http_proxy"]
|
||||
env['https_proxy'] = os.environ["http_proxy"]
|
||||
cmd = ["make", "-C", self.builddir]
|
||||
ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile,
|
||||
env=env)
|
||||
|
||||
@@ -41,7 +41,7 @@ def main():
|
||||
BRTest.logtofile = False
|
||||
|
||||
if args.list:
|
||||
print "List of tests"
|
||||
print("List of tests")
|
||||
nose2.discover(argv=[script_path,
|
||||
"-s", test_dir,
|
||||
"-v",
|
||||
@@ -52,16 +52,16 @@ def main():
|
||||
if args.download is None:
|
||||
args.download = os.getenv("BR2_DL_DIR")
|
||||
if args.download is None:
|
||||
print "Missing download directory, please use -d/--download"
|
||||
print ""
|
||||
print("Missing download directory, please use -d/--download")
|
||||
print("")
|
||||
parser.print_help()
|
||||
return 1
|
||||
|
||||
BRTest.downloaddir = os.path.abspath(args.download)
|
||||
|
||||
if args.output is None:
|
||||
print "Missing output directory, please use -o/--output"
|
||||
print ""
|
||||
print("Missing output directory, please use -o/--output")
|
||||
print("")
|
||||
parser.print_help()
|
||||
return 1
|
||||
|
||||
@@ -71,8 +71,8 @@ def main():
|
||||
BRTest.outputdir = os.path.abspath(args.output)
|
||||
|
||||
if args.all is False and len(args.testname) == 0:
|
||||
print "No test selected"
|
||||
print ""
|
||||
print("No test selected")
|
||||
print("")
|
||||
parser.print_help()
|
||||
return 1
|
||||
|
||||
@@ -80,8 +80,8 @@ def main():
|
||||
|
||||
if args.testcases != 1:
|
||||
if args.testcases < 1:
|
||||
print "Invalid number of testcases to run simultaneously"
|
||||
print ""
|
||||
print("Invalid number of testcases to run simultaneously")
|
||||
print("")
|
||||
parser.print_help()
|
||||
return 1
|
||||
# same default BR2_JLEVEL as package/Makefile.in
|
||||
@@ -93,16 +93,16 @@ def main():
|
||||
|
||||
if args.jlevel:
|
||||
if args.jlevel < 0:
|
||||
print "Invalid BR2_JLEVEL to use for each testcase"
|
||||
print ""
|
||||
print("Invalid BR2_JLEVEL to use for each testcase")
|
||||
print("")
|
||||
parser.print_help()
|
||||
return 1
|
||||
# the user can override the auto calculated value
|
||||
BRTest.jlevel = args.jlevel
|
||||
|
||||
if args.timeout_multiplier < 1:
|
||||
print "Invalid multiplier for timeout values"
|
||||
print ""
|
||||
print("Invalid multiplier for timeout values")
|
||||
print("")
|
||||
parser.print_help()
|
||||
return 1
|
||||
BRTest.timeout_multiplier = args.timeout_multiplier
|
||||
|
||||
@@ -40,7 +40,7 @@ class TestATFAllwinner(infra.basetest.BRTest):
|
||||
BR2_TARGET_UBOOT=y
|
||||
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
|
||||
BR2_TARGET_UBOOT_CUSTOM_VERSION=y
|
||||
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.09"
|
||||
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.11"
|
||||
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="bananapi_m64"
|
||||
BR2_TARGET_UBOOT_NEEDS_DTC=y
|
||||
BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
|
||||
@@ -63,7 +63,7 @@ class TestATFMarvell(infra.basetest.BRTest):
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/MarvellEmbeddedProcessors/atf-marvell.git"
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="43965481990fd92e9666cf9371a8cf478055ec7c"
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="711ecd32afe465b38052b5ba374c825b158eea18"
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="a80x0_mcbin"
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33=y
|
||||
@@ -74,7 +74,7 @@ class TestATFMarvell(infra.basetest.BRTest):
|
||||
BR2_TARGET_UBOOT=y
|
||||
BR2_TARGET_UBOOT_BOARDNAME="mvebu_mcbin-88f8040"
|
||||
BR2_TARGET_UBOOT_CUSTOM_VERSION=y
|
||||
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.09"
|
||||
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2018.09"
|
||||
BR2_TARGET_UBOOT_NEEDS_DTC=y
|
||||
"""
|
||||
|
||||
|
||||
7
buildroot/support/testing/tests/core/device_table2.txt
Normal file
7
buildroot/support/testing/tests/core/device_table2.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
# <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
|
||||
/usr/sbin/getcap f 755 0 0 - - - - -
|
||||
|xattr cap_sys_nice+eip
|
||||
# leading spaces are ignored for xattr
|
||||
|xattr cap_kill+eip
|
||||
# leading tabs are ignored for xattr
|
||||
|xattr cap_sys_time+eip
|
||||
@@ -0,0 +1 @@
|
||||
CONFIG_SQUASHFS_XATTR=y
|
||||
@@ -0,0 +1,47 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
import infra.basetest
|
||||
|
||||
|
||||
class TestFileCapabilities(infra.basetest.BRTest):
|
||||
config = \
|
||||
"""
|
||||
BR2_arm=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt {}"
|
||||
BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES=y
|
||||
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.11.3"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="vexpress"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{}"
|
||||
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="vexpress-v2p-ca9"
|
||||
BR2_PACKAGE_LIBCAP=y
|
||||
BR2_PACKAGE_LIBCAP_TOOLS=y
|
||||
BR2_TARGET_ROOTFS_SQUASHFS=y
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
""".format(infra.filepath("tests/core/device_table2.txt"),
|
||||
infra.filepath("tests/core/squashfs-xattr-kernel.config"))
|
||||
|
||||
def test_run(self):
|
||||
img = os.path.join(self.builddir, "images", "rootfs.squashfs")
|
||||
subprocess.call(["truncate", "-s", "%1M", img])
|
||||
|
||||
self.emulator.boot(arch="armv7",
|
||||
kernel=os.path.join(self.builddir, "images", "zImage"),
|
||||
kernel_cmdline=["root=/dev/mmcblk0",
|
||||
"rootfstype=squashfs"],
|
||||
options=["-drive", "file={},if=sd,format=raw".format(img),
|
||||
"-M", "vexpress-a9",
|
||||
"-dtb", os.path.join(self.builddir, "images", "vexpress-v2p-ca9.dtb")])
|
||||
self.emulator.login()
|
||||
|
||||
cmd = "getcap -v /usr/sbin/getcap"
|
||||
output, _ = self.emulator.run(cmd)
|
||||
self.assertIn("cap_kill", output[0])
|
||||
self.assertIn("cap_sys_nice", output[0])
|
||||
self.assertIn("cap_sys_time", output[0])
|
||||
self.assertIn("+eip", output[0])
|
||||
110
buildroot/support/testing/tests/core/test_hardening.py
Normal file
110
buildroot/support/testing/tests/core/test_hardening.py
Normal file
@@ -0,0 +1,110 @@
|
||||
import os
|
||||
import subprocess
|
||||
import json
|
||||
|
||||
import infra.basetest
|
||||
|
||||
|
||||
class TestHardeningBase(infra.basetest.BRTest):
|
||||
config = \
|
||||
"""
|
||||
BR2_powerpc64=y
|
||||
BR2_powerpc_e5500=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc64-e5500/tarballs/powerpc64-e5500--glibc--stable-2018.02-2.tar.bz2"
|
||||
BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_1=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
||||
BR2_PACKAGE_LIGHTTPD=y
|
||||
BR2_PACKAGE_HOST_CHECKSEC=y
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
"""
|
||||
|
||||
checksec_files = ["usr/sbin/lighttpd", "bin/busybox"]
|
||||
|
||||
def checksec_run(self, target_file):
|
||||
filepath = os.path.join(self.builddir, "target", target_file)
|
||||
cmd = ["host/bin/checksec", "--output", "json", "--file", filepath]
|
||||
# Checksec is being used for elf file analysis only. There are no
|
||||
# assumptions of target/run-time checks as part of this testing.
|
||||
ret = subprocess.check_output(cmd,
|
||||
stderr=open(os.devnull, "w"),
|
||||
cwd=self.builddir,
|
||||
env={"LANG": "C"})
|
||||
return json.loads(ret)
|
||||
|
||||
|
||||
class TestRelro(TestHardeningBase):
|
||||
config = TestHardeningBase.config + \
|
||||
"""
|
||||
BR2_RELRO_FULL=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
for f in self.checksec_files:
|
||||
out = self.checksec_run(f)
|
||||
self.assertEqual(out["file"]["relro"], "full")
|
||||
self.assertEqual(out["file"]["pie"], "yes")
|
||||
|
||||
|
||||
class TestRelroPartial(TestHardeningBase):
|
||||
config = TestHardeningBase.config + \
|
||||
"""
|
||||
BR2_RELRO_PARTIAL=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
for f in self.checksec_files:
|
||||
out = self.checksec_run(f)
|
||||
self.assertEqual(out["file"]["relro"], "partial")
|
||||
self.assertEqual(out["file"]["pie"], "no")
|
||||
|
||||
|
||||
class TestSspNone(TestHardeningBase):
|
||||
config = TestHardeningBase.config + \
|
||||
"""
|
||||
BR2_SSP_NONE=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
for f in self.checksec_files:
|
||||
out = self.checksec_run(f)
|
||||
self.assertEqual(out["file"]["canary"], "no")
|
||||
|
||||
|
||||
class TestSspStrong(TestHardeningBase):
|
||||
config = TestHardeningBase.config + \
|
||||
"""
|
||||
BR2_SSP_STRONG=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
for f in self.checksec_files:
|
||||
out = self.checksec_run(f)
|
||||
self.assertEqual(out["file"]["canary"], "yes")
|
||||
|
||||
|
||||
class TestFortifyNone(TestHardeningBase):
|
||||
config = TestHardeningBase.config + \
|
||||
"""
|
||||
BR2_FORTIFY_SOURCE_NONE=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
for f in self.checksec_files:
|
||||
out = self.checksec_run(f)
|
||||
self.assertEqual(out["file"]["fortified"], "0")
|
||||
|
||||
|
||||
class TestFortifyConserv(TestHardeningBase):
|
||||
config = TestHardeningBase.config + \
|
||||
"""
|
||||
BR2_FORTIFY_SOURCE_1=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
for f in self.checksec_files:
|
||||
out = self.checksec_run(f)
|
||||
self.assertNotEqual(out["file"]["fortified"], "0")
|
||||
@@ -41,8 +41,8 @@ class TestPostScripts(infra.basetest.BRTest):
|
||||
os.path.join(self.builddir, "target"),
|
||||
os.path.join(self.builddir, "target"))
|
||||
self.check_post_log_file("post-fakeroot.log",
|
||||
os.path.join(self.builddir, "build/buildroot-fs/target"),
|
||||
os.path.join(self.builddir, "build/buildroot-fs/target"))
|
||||
os.path.join(self.builddir, "build/buildroot-fs/tar/target"),
|
||||
os.path.join(self.builddir, "build/buildroot-fs/tar/target"))
|
||||
self.check_post_log_file("post-image.log",
|
||||
os.path.join(self.builddir, "images"),
|
||||
os.path.join(self.builddir, "target"))
|
||||
|
||||
51
buildroot/support/testing/tests/fs/test_f2fs.py
Normal file
51
buildroot/support/testing/tests/fs/test_f2fs.py
Normal file
@@ -0,0 +1,51 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
import infra.basetest
|
||||
|
||||
|
||||
def dumpf2fs_getprop(out, prop):
|
||||
for line in out:
|
||||
fields = line.split(" = ")
|
||||
if fields[0] == prop:
|
||||
return fields[1].strip()
|
||||
|
||||
|
||||
class TestF2FS(infra.basetest.BRTest):
|
||||
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
|
||||
"""
|
||||
BR2_TARGET_ROOTFS_F2FS=y
|
||||
BR2_TARGET_ROOTFS_F2FS_SIZE="128M"
|
||||
BR2_TARGET_ROOTFS_F2FS_OVERPROVISION=0
|
||||
BR2_TARGET_ROOTFS_F2FS_DISCARD=y
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7"
|
||||
BR2_LINUX_KERNEL_USE_DEFCONFIG=y
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="vexpress"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{}"
|
||||
""".format(infra.filepath("conf/f2fs-kernel-fragment.config"))
|
||||
|
||||
def test_run(self):
|
||||
img = os.path.join(self.builddir, "images", "rootfs.f2fs")
|
||||
out = subprocess.check_output(["host/sbin/dump.f2fs", img],
|
||||
cwd=self.builddir,
|
||||
env={"LANG": "C"})
|
||||
out = out.splitlines()
|
||||
prop = dumpf2fs_getprop(out, "Info: total sectors")
|
||||
self.assertEqual(prop, "262144 (128 MB)")
|
||||
|
||||
kernel = os.path.join(self.builddir, "images", "zImage")
|
||||
kernel_cmdline = ["root=/dev/mmcblk0", "rootfstype=f2fs",
|
||||
"console=ttyAMA0"]
|
||||
dtb = infra.download(self.downloaddir, "vexpress-v2p-ca9.dtb")
|
||||
options = ["-M", "vexpress-a9", "-dtb", dtb,
|
||||
"-drive", "file={},if=sd,format=raw".format(img)]
|
||||
self.emulator.boot(arch="armv7", kernel=kernel,
|
||||
kernel_cmdline=kernel_cmdline,
|
||||
options=options)
|
||||
self.emulator.login()
|
||||
cmd = "mount | grep '/dev/root on / type f2fs'"
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 0)
|
||||
@@ -0,0 +1,32 @@
|
||||
from tests.package.test_python import TestPythonBase
|
||||
|
||||
|
||||
class TestPythonAutobahn(TestPythonBase):
|
||||
def import_test(self):
|
||||
cmd = self.interpreter + " -c 'import autobahn.wamp'"
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 0)
|
||||
|
||||
|
||||
class TestPythonPy2Autobahn(TestPythonAutobahn):
|
||||
config = TestPythonBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON=y
|
||||
BR2_PACKAGE_PYTHON_AUTOBAHN=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
self.import_test()
|
||||
|
||||
|
||||
class TestPythonPy3Autobahn(TestPythonAutobahn):
|
||||
config = TestPythonBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_AUTOBAHN=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
self.import_test()
|
||||
@@ -0,0 +1,34 @@
|
||||
from tests.package.test_python import TestPythonBase
|
||||
|
||||
|
||||
class TestPythonIncremental(TestPythonBase):
|
||||
def str_test(self):
|
||||
cmd = self.interpreter + " -c 'import incremental;"
|
||||
cmd += "v = incremental.Version(\"package\", 1, 2, 3, release_candidate=4);"
|
||||
cmd += "assert(str(v) == \"[package, version 1.2.3rc4]\")'"
|
||||
_, exit_code = self.emulator.run(cmd, timeout=30)
|
||||
self.assertEqual(exit_code, 0)
|
||||
|
||||
|
||||
class TestPythonPy2Incremental(TestPythonIncremental):
|
||||
config = TestPythonBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON=y
|
||||
BR2_PACKAGE_PYTHON_INCREMENTAL=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
self.str_test()
|
||||
|
||||
|
||||
class TestPythonPy3Incremental(TestPythonIncremental):
|
||||
config = TestPythonBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_INCREMENTAL=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
self.str_test()
|
||||
@@ -0,0 +1,54 @@
|
||||
from tests.package.test_python import TestPythonBase
|
||||
|
||||
TEST_SCRIPT = """
|
||||
from twisted.internet import protocol, reactor, endpoints
|
||||
class F(protocol.Factory):
|
||||
pass
|
||||
endpoints.serverFromString(reactor, "tcp:1234").listen(F())
|
||||
reactor.run()
|
||||
"""
|
||||
|
||||
|
||||
class TestPythonTwisted(TestPythonBase):
|
||||
def import_test(self):
|
||||
cmd = "printf '{}' > test.py".format(TEST_SCRIPT)
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 0)
|
||||
|
||||
cmd = "netstat -ltn 2>/dev/null | grep 0.0.0.0:1234"
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 1)
|
||||
|
||||
cmd = self.interpreter + " test.py &"
|
||||
# give some time to setup the server
|
||||
cmd += "sleep 30"
|
||||
_, exit_code = self.emulator.run(cmd, timeout=35)
|
||||
self.assertEqual(exit_code, 0)
|
||||
|
||||
cmd = "netstat -ltn 2>/dev/null | grep 0.0.0.0:1234"
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 0)
|
||||
|
||||
|
||||
class TestPythonPy2Twisted(TestPythonTwisted):
|
||||
config = TestPythonBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON=y
|
||||
BR2_PACKAGE_PYTHON_TWISTED=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
self.import_test()
|
||||
|
||||
|
||||
class TestPythonPy3Twisted(TestPythonTwisted):
|
||||
config = TestPythonBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_TWISTED=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
self.import_test()
|
||||
34
buildroot/support/testing/tests/package/test_python_txaio.py
Normal file
34
buildroot/support/testing/tests/package/test_python_txaio.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from tests.package.test_python import TestPythonBase
|
||||
|
||||
|
||||
class TestPythonPy2Txaio(TestPythonBase):
|
||||
config = TestPythonBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON=y
|
||||
BR2_PACKAGE_PYTHON_TXAIO=y
|
||||
BR2_PACKAGE_PYTHON_TWISTED=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
cmd = self.interpreter + " -c 'import txaio;"
|
||||
cmd += "txaio.use_twisted();"
|
||||
cmd += "f0 = txaio.create_future()'"
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 0)
|
||||
|
||||
|
||||
class TestPythonPy3Txaio(TestPythonBase):
|
||||
config = TestPythonBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_TXAIO=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
cmd = self.interpreter + " -c 'import txaio;"
|
||||
cmd += "txaio.use_asyncio();"
|
||||
cmd += "f0 = txaio.create_future()'"
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 0)
|
||||
@@ -0,0 +1,32 @@
|
||||
from tests.package.test_python import TestPythonBase
|
||||
|
||||
|
||||
class TestPythonTxtorcon(TestPythonBase):
|
||||
def import_test(self):
|
||||
cmd = self.interpreter + " -c 'import txtorcon'"
|
||||
_, exit_code = self.emulator.run(cmd, timeout=30)
|
||||
self.assertEqual(exit_code, 0)
|
||||
|
||||
|
||||
class TestPythonPy2Txtorcon(TestPythonTxtorcon):
|
||||
config = TestPythonBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON=y
|
||||
BR2_PACKAGE_PYTHON_TXTORCON=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
self.import_test()
|
||||
|
||||
|
||||
class TestPythonPy3Txtorcon(TestPythonTxtorcon):
|
||||
config = TestPythonBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_TXTORCON=y
|
||||
"""
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
self.import_test()
|
||||
Reference in New Issue
Block a user