1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (C) 2020 Bootlin
3 # Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
7 from sqfs_common import *
9 @pytest.mark.boardspec('sandbox')
10 @pytest.mark.buildconfigspec('cmd_fs_generic')
11 @pytest.mark.buildconfigspec('cmd_squashfs')
12 @pytest.mark.buildconfigspec('fs_squashfs')
13 @pytest.mark.requiredtool('mksquashfs')
14 def test_sqfs_load(u_boot_console):
16 sqfs_generate_image(cons)
17 command = "sqfsload host 0 $kernel_addr_r "
18 path = os.path.join(cons.config.build_dir, "sqfs")
21 output = u_boot_console.run_command("host bind 0 " + path)
22 output = u_boot_console.run_command(command + "xxx")
23 assert "File not found." in output
24 output = u_boot_console.run_command(command + "frag_only")
25 assert "100 bytes read in" in output
26 output = u_boot_console.run_command(command + "blks_frag")
27 assert "5100 bytes read in" in output
28 output = u_boot_console.run_command(command + "blks_only")
29 assert "4096 bytes read in" in output
30 output = u_boot_console.run_command(command + "sym")
31 assert "100 bytes read in" in output