u-boot-brain/test/py/tests/test_fs/test_squashfs/test_sqfs_ls.py
Joao Marcos Costa 74795f1e35 test/py: fix SquashFS tests
Use "cons.config.build_dir" instead of writing to the source directory
(read-only). This will fix the test failures in Azure.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
2020-08-10 10:37:50 -04:00

28 lines
932 B
Python

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020 Bootlin
# Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
import os
import pytest
from sqfs_common import *
@pytest.mark.boardspec('sandbox')
@pytest.mark.buildconfigspec('cmd_fs_generic')
@pytest.mark.buildconfigspec('cmd_squashfs')
@pytest.mark.buildconfigspec('fs_squashfs')
@pytest.mark.requiredtool('mksquashfs')
def test_sqfs_ls(u_boot_console):
cons = u_boot_console
sqfs_generate_image(cons)
path = os.path.join(cons.config.build_dir, "sqfs")
try:
output = u_boot_console.run_command("host bind 0 " + path)
output = u_boot_console.run_command("sqfsls host 0")
assert "4 file(s), 0 dir(s)" in output
assert "<SYM> sym" in output
output = u_boot_console.run_command("sqfsls host 0 xxx")
assert "** Cannot find directory. **" in output
except:
sqfs_clean(cons)
sqfs_clean(cons)