From ef8d1f1b15858ed0b86fb92e03d1c3797c6c1e1f Mon Sep 17 00:00:00 2001 From: Ricardo Martincoski Date: Thu, 5 Oct 2017 18:42:09 -0300 Subject: 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 Acked-by: "Yann E. MORIN" Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- support/testing/tests/fs/test_ext.py | 9 +++++++-- support/testing/tests/fs/test_iso9660.py | 8 ++++++-- support/testing/tests/fs/test_jffs2.py | 2 ++ support/testing/tests/fs/test_squashfs.py | 1 + support/testing/tests/fs/test_ubi.py | 1 + support/testing/tests/fs/test_yaffs2.py | 1 + 6 files changed, 18 insertions(+), 4 deletions(-) (limited to 'support/testing/tests/fs') diff --git a/support/testing/tests/fs/test_ext.py b/support/testing/tests/fs/test_ext.py index 49bce45dc8..f5f9e9fdf1 100644 --- a/support/testing/tests/fs/test_ext.py +++ b/support/testing/tests/fs/test_ext.py @@ -12,6 +12,7 @@ RESBLKCNT_PROP = "Reserved block count" CHECK_FS_TYPE_CMD = "mount | grep '/dev/root on / type {}'" + def dumpe2fs_run(builddir, image): cmd = ["host/sbin/dumpe2fs", os.path.join("images", image)] ret = subprocess.check_output(cmd, @@ -20,12 +21,14 @@ def dumpe2fs_run(builddir, image): env={"LANG": "C"}) return ret.strip().splitlines() + def dumpe2fs_getprop(out, prop): for line in out: fields = line.split(": ") if fields[0] == prop: return fields[1].strip() + def boot_img_and_check_fs_type(emulator, builddir, fs_type): img = os.path.join(builddir, "images", "rootfs.{}".format(fs_type)) 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)) return exit_code + class TestExt2(infra.basetest.BRTest): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ @@ -55,6 +59,7 @@ class TestExt2(infra.basetest.BRTest): self.builddir, "ext2") self.assertEqual(exit_code, 0) + class TestExt2r1(infra.basetest.BRTest): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ @@ -74,6 +79,7 @@ class TestExt2r1(infra.basetest.BRTest): self.builddir, "ext2") self.assertEqual(exit_code, 0) + class TestExt3(infra.basetest.BRTest): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ @@ -92,6 +98,7 @@ class TestExt3(infra.basetest.BRTest): self.builddir, "ext3") self.assertEqual(exit_code, 0) + class TestExt4(infra.basetest.BRTest): 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, self.builddir, "ext4") self.assertEqual(exit_code, 0) - - diff --git a/support/testing/tests/fs/test_iso9660.py b/support/testing/tests/fs/test_iso9660.py index 60dcbdc139..41430eb4d2 100644 --- a/support/testing/tests/fs/test_iso9660.py +++ b/support/testing/tests/fs/test_iso9660.py @@ -25,6 +25,7 @@ BASIC_CONFIG = \ # BR2_TARGET_ROOTFS_TAR is not set """.format(infra.filepath("conf/minimal-x86-qemu-kernel.config")) + def test_mount_internal_external(emulator, builddir, internal=True): img = os.path.join(builddir, "images", "rootfs.iso9660") 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) return exit_code + def test_touch_file(emulator): _, exit_code = emulator.run("touch test") return exit_code # # Grub 2 -# + class TestIso9660Grub2External(infra.basetest.BRTest): config = BASIC_CONFIG + \ @@ -65,6 +67,7 @@ class TestIso9660Grub2External(infra.basetest.BRTest): exit_code = test_touch_file(self.emulator) self.assertEqual(exit_code, 1) + class TestIso9660Grub2Internal(infra.basetest.BRTest): config = BASIC_CONFIG + \ """ @@ -86,7 +89,7 @@ class TestIso9660Grub2Internal(infra.basetest.BRTest): # # Syslinux -# + class TestIso9660SyslinuxExternal(infra.basetest.BRTest): config = BASIC_CONFIG + \ @@ -106,6 +109,7 @@ class TestIso9660SyslinuxExternal(infra.basetest.BRTest): exit_code = test_touch_file(self.emulator) self.assertEqual(exit_code, 1) + class TestIso9660SyslinuxInternal(infra.basetest.BRTest): config = BASIC_CONFIG + \ """ diff --git a/support/testing/tests/fs/test_jffs2.py b/support/testing/tests/fs/test_jffs2.py index a84c858238..2ff5099180 100644 --- a/support/testing/tests/fs/test_jffs2.py +++ b/support/testing/tests/fs/test_jffs2.py @@ -3,6 +3,7 @@ import subprocess import infra.basetest + def jffs2dump_find_file(files_list, fname): for file_name in files_list: file_name = file_name.strip() @@ -10,6 +11,7 @@ def jffs2dump_find_file(files_list, fname): return True return False + class TestJffs2(infra.basetest.BRTest): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ diff --git a/support/testing/tests/fs/test_squashfs.py b/support/testing/tests/fs/test_squashfs.py index 9fad28f834..066c054342 100644 --- a/support/testing/tests/fs/test_squashfs.py +++ b/support/testing/tests/fs/test_squashfs.py @@ -3,6 +3,7 @@ import subprocess import infra.basetest + class TestSquashfs(infra.basetest.BRTest): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ diff --git a/support/testing/tests/fs/test_ubi.py b/support/testing/tests/fs/test_ubi.py index 360932a0bf..015d82f769 100644 --- a/support/testing/tests/fs/test_ubi.py +++ b/support/testing/tests/fs/test_ubi.py @@ -3,6 +3,7 @@ import os import infra.basetest + class TestUbi(infra.basetest.BRTest): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ diff --git a/support/testing/tests/fs/test_yaffs2.py b/support/testing/tests/fs/test_yaffs2.py index a11c1a40a7..b60e90e660 100644 --- a/support/testing/tests/fs/test_yaffs2.py +++ b/support/testing/tests/fs/test_yaffs2.py @@ -2,6 +2,7 @@ import os import infra.basetest + class TestYaffs2(infra.basetest.BRTest): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ infra.basetest.MINIMAL_CONFIG + \ -- cgit v1.2.1