support/testing: fix code style

Fix the trivial warnings from flake8:
 - remove modules imported but unused;
 - use 2 lines before class or module level method;
 - remove blank line at end of file.

Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Ricardo Martincoski 2017-10-05 18:42:09 -03:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent 2927f412be
commit ef8d1f1b15
21 changed files with 59 additions and 20 deletions

View File

@ -1,4 +1,3 @@
import contextlib
import os import os
import re import re
import sys import sys
@ -8,6 +7,7 @@ from urllib2 import urlopen, HTTPError, URLError
ARTIFACTS_URL = "http://autobuild.buildroot.net/artefacts/" ARTIFACTS_URL = "http://autobuild.buildroot.net/artefacts/"
def open_log_file(builddir, stage, logtofile=True): def open_log_file(builddir, stage, logtofile=True):
""" """
Open a file for logging and return its handler. Open a file for logging and return its handler.
@ -20,9 +20,11 @@ def open_log_file(builddir, stage, logtofile=True):
fhandle = sys.stdout fhandle = sys.stdout
return fhandle return fhandle
def filepath(relpath): def filepath(relpath):
return os.path.join(os.getcwd(), "support/testing", relpath) return os.path.join(os.getcwd(), "support/testing", relpath)
def download(dldir, filename): def download(dldir, filename):
finalpath = os.path.join(dldir, filename) finalpath = os.path.join(dldir, filename)
if os.path.exists(finalpath): if os.path.exists(finalpath):
@ -46,6 +48,7 @@ def download(dldir, filename):
os.rename(tmpfile, finalpath) os.rename(tmpfile, finalpath)
return finalpath return finalpath
def get_elf_arch_tag(builddir, prefix, fpath, tag): def get_elf_arch_tag(builddir, prefix, fpath, tag):
""" """
Runs the cross readelf on 'fpath', then extracts the value of tag 'tag'. Runs the cross readelf on 'fpath', then extracts the value of tag 'tag'.
@ -66,9 +69,11 @@ def get_elf_arch_tag(builddir, prefix, fpath, tag):
return m.group(1) return m.group(1)
return None return None
def get_file_arch(builddir, prefix, fpath): def get_file_arch(builddir, prefix, fpath):
return get_elf_arch_tag(builddir, prefix, fpath, "Tag_CPU_arch") return get_elf_arch_tag(builddir, prefix, fpath, "Tag_CPU_arch")
def get_elf_prog_interpreter(builddir, prefix, fpath): def get_elf_prog_interpreter(builddir, prefix, fpath):
""" """
Runs the cross readelf on 'fpath' to extract the program interpreter Runs the cross readelf on 'fpath' to extract the program interpreter

View File

@ -28,6 +28,7 @@ MINIMAL_CONFIG = \
# BR2_TARGET_ROOTFS_TAR is not set # BR2_TARGET_ROOTFS_TAR is not set
""" """
class BRTest(unittest.TestCase): class BRTest(unittest.TestCase):
config = None config = None
downloaddir = None downloaddir = None
@ -47,6 +48,7 @@ class BRTest(unittest.TestCase):
def show_msg(self, msg): def show_msg(self, msg):
print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"), print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
self.testname, msg) self.testname, msg)
def setUp(self): def setUp(self):
self.show_msg("Starting") self.show_msg("Starting")
self.b = Builder(self.config, self.builddir, self.logtofile) self.b = Builder(self.config, self.builddir, self.logtofile)

View File

@ -4,6 +4,7 @@ import subprocess
import infra import infra
class Builder(object): class Builder(object):
def __init__(self, config, builddir, logtofile): def __init__(self, config, builddir, logtofile):
self.config = '\n'.join([line.lstrip() for line in self.config = '\n'.join([line.lstrip() for line in

View File

@ -7,6 +7,7 @@ import multiprocessing
from infra.basetest import BRTest from infra.basetest import BRTest
def main(): def main():
parser = argparse.ArgumentParser(description='Run Buildroot tests') parser = argparse.ArgumentParser(description='Run Buildroot tests')
parser.add_argument('testname', nargs='*', parser.add_argument('testname', nargs='*',
@ -116,5 +117,6 @@ def main():
nose2.discover(argv=nose2_args) nose2.discover(argv=nose2_args)
if __name__ == "__main__": if __name__ == "__main__":
sys.exit(main()) sys.exit(main())

View File

@ -3,6 +3,7 @@ import csv
import infra.basetest import infra.basetest
class TestPostScripts(infra.basetest.BRTest): class TestPostScripts(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """

View File

@ -3,9 +3,11 @@ import subprocess
import infra.basetest import infra.basetest
def compare_file(file1, file2): def compare_file(file1, file2):
return subprocess.call(["cmp", file1, file2]) return subprocess.call(["cmp", file1, file2])
class TestRootfsOverlay(infra.basetest.BRTest): class TestRootfsOverlay(infra.basetest.BRTest):
rootfs_overlay_path = infra.filepath("tests/core/rootfs-overlay") rootfs_overlay_path = infra.filepath("tests/core/rootfs-overlay")

View File

@ -2,12 +2,14 @@ import os
import infra.basetest import infra.basetest
def boot_armv5_cpio(emulator, builddir): def boot_armv5_cpio(emulator, builddir):
img = os.path.join(builddir, "images", "rootfs.cpio") img = os.path.join(builddir, "images", "rootfs.cpio")
emulator.boot(arch="armv5", kernel="builtin", emulator.boot(arch="armv5", kernel="builtin",
options=["-initrd", img]) options=["-initrd", img])
emulator.login() emulator.login()
class TestNoTimezone(infra.basetest.BRTest): class TestNoTimezone(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """
@ -23,6 +25,7 @@ class TestNoTimezone(infra.basetest.BRTest):
tz, _ = self.emulator.run("TZ=America/Los_Angeles date +%Z") tz, _ = self.emulator.run("TZ=America/Los_Angeles date +%Z")
self.assertEqual(tz[0].strip(), "UTC") self.assertEqual(tz[0].strip(), "UTC")
class TestGlibcAllTimezone(infra.basetest.BRTest): class TestGlibcAllTimezone(infra.basetest.BRTest):
config = \ config = \
""" """
@ -44,6 +47,7 @@ class TestGlibcAllTimezone(infra.basetest.BRTest):
tz, _ = self.emulator.run("TZ=Europe/Paris date +%Z") tz, _ = self.emulator.run("TZ=Europe/Paris date +%Z")
self.assertEqual(tz[0].strip(), "CET") self.assertEqual(tz[0].strip(), "CET")
class TestGlibcNonDefaultLimitedTimezone(infra.basetest.BRTest): class TestGlibcNonDefaultLimitedTimezone(infra.basetest.BRTest):
config = \ config = \
""" """

View File

@ -12,6 +12,7 @@ RESBLKCNT_PROP = "Reserved block count"
CHECK_FS_TYPE_CMD = "mount | grep '/dev/root on / type {}'" CHECK_FS_TYPE_CMD = "mount | grep '/dev/root on / type {}'"
def dumpe2fs_run(builddir, image): def dumpe2fs_run(builddir, image):
cmd = ["host/sbin/dumpe2fs", os.path.join("images", image)] cmd = ["host/sbin/dumpe2fs", os.path.join("images", image)]
ret = subprocess.check_output(cmd, ret = subprocess.check_output(cmd,
@ -20,12 +21,14 @@ def dumpe2fs_run(builddir, image):
env={"LANG": "C"}) env={"LANG": "C"})
return ret.strip().splitlines() return ret.strip().splitlines()
def dumpe2fs_getprop(out, prop): def dumpe2fs_getprop(out, prop):
for line in out: for line in out:
fields = line.split(": ") fields = line.split(": ")
if fields[0] == prop: if fields[0] == prop:
return fields[1].strip() return fields[1].strip()
def boot_img_and_check_fs_type(emulator, builddir, fs_type): def boot_img_and_check_fs_type(emulator, builddir, fs_type):
img = os.path.join(builddir, "images", "rootfs.{}".format(fs_type)) img = os.path.join(builddir, "images", "rootfs.{}".format(fs_type))
emulator.boot(arch="armv7", emulator.boot(arch="armv7",
@ -37,6 +40,7 @@ def boot_img_and_check_fs_type(emulator, builddir, fs_type):
_, exit_code = emulator.run(CHECK_FS_TYPE_CMD.format(fs_type)) _, exit_code = emulator.run(CHECK_FS_TYPE_CMD.format(fs_type))
return exit_code return exit_code
class TestExt2(infra.basetest.BRTest): class TestExt2(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """
@ -55,6 +59,7 @@ class TestExt2(infra.basetest.BRTest):
self.builddir, "ext2") self.builddir, "ext2")
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)
class TestExt2r1(infra.basetest.BRTest): class TestExt2r1(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """
@ -74,6 +79,7 @@ class TestExt2r1(infra.basetest.BRTest):
self.builddir, "ext2") self.builddir, "ext2")
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)
class TestExt3(infra.basetest.BRTest): class TestExt3(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """
@ -92,6 +98,7 @@ class TestExt3(infra.basetest.BRTest):
self.builddir, "ext3") self.builddir, "ext3")
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)
class TestExt4(infra.basetest.BRTest): class TestExt4(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """
@ -116,5 +123,3 @@ class TestExt4(infra.basetest.BRTest):
exit_code = boot_img_and_check_fs_type(self.emulator, exit_code = boot_img_and_check_fs_type(self.emulator,
self.builddir, "ext4") self.builddir, "ext4")
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)

View File

@ -25,6 +25,7 @@ BASIC_CONFIG = \
# BR2_TARGET_ROOTFS_TAR is not set # BR2_TARGET_ROOTFS_TAR is not set
""".format(infra.filepath("conf/minimal-x86-qemu-kernel.config")) """.format(infra.filepath("conf/minimal-x86-qemu-kernel.config"))
def test_mount_internal_external(emulator, builddir, internal=True): def test_mount_internal_external(emulator, builddir, internal=True):
img = os.path.join(builddir, "images", "rootfs.iso9660") img = os.path.join(builddir, "images", "rootfs.iso9660")
emulator.boot(arch="i386", options=["-cdrom", img]) emulator.boot(arch="i386", options=["-cdrom", img])
@ -38,13 +39,14 @@ def test_mount_internal_external(emulator, builddir, internal=True):
_, exit_code = emulator.run(cmd) _, exit_code = emulator.run(cmd)
return exit_code return exit_code
def test_touch_file(emulator): def test_touch_file(emulator):
_, exit_code = emulator.run("touch test") _, exit_code = emulator.run("touch test")
return exit_code return exit_code
# #
# Grub 2 # Grub 2
#
class TestIso9660Grub2External(infra.basetest.BRTest): class TestIso9660Grub2External(infra.basetest.BRTest):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
@ -65,6 +67,7 @@ class TestIso9660Grub2External(infra.basetest.BRTest):
exit_code = test_touch_file(self.emulator) exit_code = test_touch_file(self.emulator)
self.assertEqual(exit_code, 1) self.assertEqual(exit_code, 1)
class TestIso9660Grub2Internal(infra.basetest.BRTest): class TestIso9660Grub2Internal(infra.basetest.BRTest):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
""" """
@ -86,7 +89,7 @@ class TestIso9660Grub2Internal(infra.basetest.BRTest):
# #
# Syslinux # Syslinux
#
class TestIso9660SyslinuxExternal(infra.basetest.BRTest): class TestIso9660SyslinuxExternal(infra.basetest.BRTest):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
@ -106,6 +109,7 @@ class TestIso9660SyslinuxExternal(infra.basetest.BRTest):
exit_code = test_touch_file(self.emulator) exit_code = test_touch_file(self.emulator)
self.assertEqual(exit_code, 1) self.assertEqual(exit_code, 1)
class TestIso9660SyslinuxInternal(infra.basetest.BRTest): class TestIso9660SyslinuxInternal(infra.basetest.BRTest):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
""" """

View File

@ -3,6 +3,7 @@ import subprocess
import infra.basetest import infra.basetest
def jffs2dump_find_file(files_list, fname): def jffs2dump_find_file(files_list, fname):
for file_name in files_list: for file_name in files_list:
file_name = file_name.strip() file_name = file_name.strip()
@ -10,6 +11,7 @@ def jffs2dump_find_file(files_list, fname):
return True return True
return False return False
class TestJffs2(infra.basetest.BRTest): class TestJffs2(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """

View File

@ -3,6 +3,7 @@ import subprocess
import infra.basetest import infra.basetest
class TestSquashfs(infra.basetest.BRTest): class TestSquashfs(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """

View File

@ -3,6 +3,7 @@ import os
import infra.basetest import infra.basetest
class TestUbi(infra.basetest.BRTest): class TestUbi(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """

View File

@ -2,6 +2,7 @@ import os
import infra.basetest import infra.basetest
class TestYaffs2(infra.basetest.BRTest): class TestYaffs2(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
infra.basetest.MINIMAL_CONFIG + \ infra.basetest.MINIMAL_CONFIG + \

View File

@ -2,6 +2,7 @@ import os
import subprocess import subprocess
import infra.basetest import infra.basetest
class InitSystemBase(infra.basetest.BRTest): class InitSystemBase(infra.basetest.BRTest):
def startEmulator(self, fs_type, kernel=None, dtb=None, init=None): def startEmulator(self, fs_type, kernel=None, dtb=None, init=None):

View File

@ -1,6 +1,7 @@
import infra.basetest import infra.basetest
from tests.init.base import InitSystemBase as InitSystemBase from tests.init.base import InitSystemBase as InitSystemBase
class InitSystemBusyboxBase(InitSystemBase): class InitSystemBusyboxBase(InitSystemBase):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """
@ -11,7 +12,6 @@ class InitSystemBusyboxBase(InitSystemBase):
super(InitSystemBusyboxBase, self).checkInit("/bin/busybox") super(InitSystemBusyboxBase, self).checkInit("/bin/busybox")
#-------------------------------------------------------------------------------
class TestInitSystemBusyboxRo(InitSystemBusyboxBase): class TestInitSystemBusyboxRo(InitSystemBusyboxBase):
config = InitSystemBusyboxBase.config + \ config = InitSystemBusyboxBase.config + \
""" """
@ -25,7 +25,6 @@ class TestInitSystemBusyboxRo(InitSystemBusyboxBase):
self.checkNetwork("eth0", 1) self.checkNetwork("eth0", 1)
#-------------------------------------------------------------------------------
class TestInitSystemBusyboxRw(InitSystemBusyboxBase): class TestInitSystemBusyboxRw(InitSystemBusyboxBase):
config = InitSystemBusyboxBase.config + \ config = InitSystemBusyboxBase.config + \
""" """
@ -38,7 +37,6 @@ class TestInitSystemBusyboxRw(InitSystemBusyboxBase):
self.checkNetwork("eth0", 1) self.checkNetwork("eth0", 1)
#-------------------------------------------------------------------------------
class TestInitSystemBusyboxRoNet(InitSystemBusyboxBase): class TestInitSystemBusyboxRoNet(InitSystemBusyboxBase):
config = InitSystemBusyboxBase.config + \ config = InitSystemBusyboxBase.config + \
""" """
@ -53,7 +51,6 @@ class TestInitSystemBusyboxRoNet(InitSystemBusyboxBase):
self.checkNetwork("eth0") self.checkNetwork("eth0")
#-------------------------------------------------------------------------------
class TestInitSystemBusyboxRwNet(InitSystemBusyboxBase): class TestInitSystemBusyboxRwNet(InitSystemBusyboxBase):
config = InitSystemBusyboxBase.config + \ config = InitSystemBusyboxBase.config + \
""" """

View File

@ -3,6 +3,7 @@ import pexpect
import infra.basetest import infra.basetest
from tests.init.base import InitSystemBase as InitSystemBase from tests.init.base import InitSystemBase as InitSystemBase
class TestInitSystemNone(InitSystemBase): class TestInitSystemNone(InitSystemBase):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """

View File

@ -1,6 +1,7 @@
import infra.basetest import infra.basetest
from tests.init.base import InitSystemBase as InitSystemBase from tests.init.base import InitSystemBase as InitSystemBase
class InitSystemSystemdBase(InitSystemBase): class InitSystemSystemdBase(InitSystemBase):
config = \ config = \
""" """
@ -21,7 +22,6 @@ class InitSystemSystemdBase(InitSystemBase):
super(InitSystemSystemdBase, self).checkInit("/lib/systemd/systemd") super(InitSystemSystemdBase, self).checkInit("/lib/systemd/systemd")
#-------------------------------------------------------------------------------
class TestInitSystemSystemdRoNetworkd(InitSystemSystemdBase): class TestInitSystemSystemdRoNetworkd(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \ config = InitSystemSystemdBase.config + \
""" """
@ -43,7 +43,6 @@ class TestInitSystemSystemdRoNetworkd(InitSystemSystemdBase):
self.assertEqual(out[0], "foobar") self.assertEqual(out[0], "foobar")
#-------------------------------------------------------------------------------
class TestInitSystemSystemdRwNetworkd(InitSystemSystemdBase): class TestInitSystemSystemdRwNetworkd(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \ config = InitSystemSystemdBase.config + \
""" """
@ -57,7 +56,6 @@ class TestInitSystemSystemdRwNetworkd(InitSystemSystemdBase):
self.checkNetwork("eth0") self.checkNetwork("eth0")
#-------------------------------------------------------------------------------
class TestInitSystemSystemdRoIfupdown(InitSystemSystemdBase): class TestInitSystemSystemdRoIfupdown(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \ config = InitSystemSystemdBase.config + \
""" """
@ -73,7 +71,6 @@ class TestInitSystemSystemdRoIfupdown(InitSystemSystemdBase):
self.checkNetwork("eth0") self.checkNetwork("eth0")
#-------------------------------------------------------------------------------
class TestInitSystemSystemdRwIfupdown(InitSystemSystemdBase): class TestInitSystemSystemdRwIfupdown(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \ config = InitSystemSystemdBase.config + \
""" """
@ -89,7 +86,6 @@ class TestInitSystemSystemdRwIfupdown(InitSystemSystemdBase):
self.checkNetwork("eth0") self.checkNetwork("eth0")
#-------------------------------------------------------------------------------
class TestInitSystemSystemdRoFull(InitSystemSystemdBase): class TestInitSystemSystemdRoFull(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \ config = InitSystemSystemdBase.config + \
""" """
@ -121,7 +117,6 @@ class TestInitSystemSystemdRoFull(InitSystemSystemdBase):
self.checkNetwork("eth0") self.checkNetwork("eth0")
#-------------------------------------------------------------------------------
class TestInitSystemSystemdRwFull(InitSystemSystemdBase): class TestInitSystemSystemdRwFull(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \ config = InitSystemSystemdBase.config + \
""" """

View File

@ -2,6 +2,7 @@ import os
import infra.basetest import infra.basetest
class TestDropbear(infra.basetest.BRTest): class TestDropbear(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """

View File

@ -1,5 +1,3 @@
import os
from tests.package.test_python import TestPythonBase from tests.package.test_python import TestPythonBase
# #
# The following pythong tests are not being used here: # The following pythong tests are not being used here:
@ -8,7 +6,8 @@ from tests.package.test_python import TestPythonBase
# #
# - zlib_test: IPython does not return a non-zero code the way CPython # - zlib_test: IPython does not return a non-zero code the way CPython
# does, so this test ends up being a false-negative # does, so this test ends up being a false-negative
#
class TestIPythonPy2(TestPythonBase): class TestIPythonPy2(TestPythonBase):
config = TestPythonBase.config + \ config = TestPythonBase.config + \
""" """
@ -22,6 +21,7 @@ class TestIPythonPy2(TestPythonBase):
self.math_floor_test(40) self.math_floor_test(40)
self.libc_time_test(40) self.libc_time_test(40)
class TestIPythonPy3(TestPythonBase): class TestIPythonPy3(TestPythonBase):
config = TestPythonBase.config + \ config = TestPythonBase.config + \
""" """
@ -34,5 +34,3 @@ class TestIPythonPy3(TestPythonBase):
self.login() self.login()
self.math_floor_test(40) self.math_floor_test(40)
self.libc_time_test(40) self.libc_time_test(40)

View File

@ -2,6 +2,7 @@ import os
import infra.basetest import infra.basetest
class TestPythonBase(infra.basetest.BRTest): class TestPythonBase(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
""" """
@ -40,11 +41,13 @@ class TestPythonBase(infra.basetest.BRTest):
_, exit_code = self.emulator.run(cmd, timeout) _, exit_code = self.emulator.run(cmd, timeout)
self.assertEqual(exit_code, 1) self.assertEqual(exit_code, 1)
class TestPython2(TestPythonBase): class TestPython2(TestPythonBase):
config = TestPythonBase.config + \ config = TestPythonBase.config + \
""" """
BR2_PACKAGE_PYTHON=y BR2_PACKAGE_PYTHON=y
""" """
def test_run(self): def test_run(self):
self.login() self.login()
self.version_test("Python 2") self.version_test("Python 2")
@ -52,11 +55,13 @@ class TestPython2(TestPythonBase):
self.libc_time_test() self.libc_time_test()
self.zlib_test() self.zlib_test()
class TestPython3(TestPythonBase): class TestPython3(TestPythonBase):
config = TestPythonBase.config + \ config = TestPythonBase.config + \
""" """
BR2_PACKAGE_PYTHON3=y BR2_PACKAGE_PYTHON3=y
""" """
def test_run(self): def test_run(self):
self.login() self.login()
self.version_test("Python 3") self.version_test("Python 3")

View File

@ -7,6 +7,7 @@ BASIC_CONFIG = \
# BR2_TARGET_ROOTFS_TAR is not set # BR2_TARGET_ROOTFS_TAR is not set
""" """
def has_broken_links(path): def has_broken_links(path):
for root, dirs, files in os.walk(path): for root, dirs, files in os.walk(path):
for f in files: for f in files:
@ -15,6 +16,7 @@ def has_broken_links(path):
return True return True
return False return False
class TestExternalToolchain(infra.basetest.BRTest): class TestExternalToolchain(infra.basetest.BRTest):
def common_check(self): def common_check(self):
# Check for broken symlinks # Check for broken symlinks
@ -30,6 +32,7 @@ class TestExternalToolchain(infra.basetest.BRTest):
interp_path = os.path.join(self.builddir, "target", interp[1:]) interp_path = os.path.join(self.builddir, "target", interp[1:])
self.assertTrue(os.path.exists(interp_path)) self.assertTrue(os.path.exists(interp_path))
class TestExternalToolchainSourceryArmv4(TestExternalToolchain): class TestExternalToolchainSourceryArmv4(TestExternalToolchain):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
""" """
@ -61,6 +64,7 @@ class TestExternalToolchainSourceryArmv4(TestExternalToolchain):
options=["-initrd", img]) options=["-initrd", img])
self.emulator.login() self.emulator.login()
class TestExternalToolchainSourceryArmv5(TestExternalToolchain): class TestExternalToolchainSourceryArmv5(TestExternalToolchain):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
""" """
@ -86,6 +90,7 @@ class TestExternalToolchainSourceryArmv5(TestExternalToolchain):
options=["-initrd", img]) options=["-initrd", img])
self.emulator.login() self.emulator.login()
class TestExternalToolchainSourceryArmv7(TestExternalToolchain): class TestExternalToolchainSourceryArmv7(TestExternalToolchain):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
""" """
@ -124,6 +129,7 @@ class TestExternalToolchainSourceryArmv7(TestExternalToolchain):
options=["-initrd", img]) options=["-initrd", img])
self.emulator.login() self.emulator.login()
class TestExternalToolchainLinaroArm(TestExternalToolchain): class TestExternalToolchainLinaroArm(TestExternalToolchain):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
""" """
@ -155,6 +161,7 @@ class TestExternalToolchainLinaroArm(TestExternalToolchain):
options=["-initrd", img]) options=["-initrd", img])
self.emulator.login() self.emulator.login()
class TestExternalToolchainBuildrootMusl(TestExternalToolchain): class TestExternalToolchainBuildrootMusl(TestExternalToolchain):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
""" """
@ -180,6 +187,7 @@ class TestExternalToolchainBuildrootMusl(TestExternalToolchain):
options=["-initrd", img]) options=["-initrd", img])
self.emulator.login() self.emulator.login()
class TestExternalToolchainCtngMusl(TestExternalToolchain): class TestExternalToolchainCtngMusl(TestExternalToolchain):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
""" """
@ -206,6 +214,7 @@ class TestExternalToolchainCtngMusl(TestExternalToolchain):
options=["-initrd", img]) options=["-initrd", img])
self.emulator.login() self.emulator.login()
class TestExternalToolchainBuildrootuClibc(TestExternalToolchain): class TestExternalToolchainBuildrootuClibc(TestExternalToolchain):
config = BASIC_CONFIG + \ config = BASIC_CONFIG + \
""" """
@ -230,6 +239,7 @@ class TestExternalToolchainBuildrootuClibc(TestExternalToolchain):
options=["-initrd", img]) options=["-initrd", img])
self.emulator.login() self.emulator.login()
class TestExternalToolchainCCache(TestExternalToolchainBuildrootuClibc): class TestExternalToolchainCCache(TestExternalToolchainBuildrootuClibc):
extraconfig = \ extraconfig = \
""" """