Commit 537d11f4 authored by Roman Vaughan's avatar Roman Vaughan Committed by Anas Nashif
Browse files

tests: fs: Add test case for LFN with FATFS



Rerun the same test but with CONFIG_FS_FATFS_LFN=Y and
with a long filename.

Signed-off-by: default avatarRoman Vaughan <nzsmartie@gmail.com>
Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 1fe11352
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
CONFIG_FILE_SYSTEM=y
CONFIG_LOG=y
CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_FS_FATFS_LFN=y
CONFIG_DISK_ACCESS_FLASH=y
CONFIG_DISK_FLASH_DEV_NAME="flash_ctrl"
CONFIG_DISK_FLASH_START=0
CONFIG_DISK_FLASH_MAX_RW_SIZE=256
CONFIG_DISK_ERASE_BLOCK_SIZE=0x1000
CONFIG_DISK_FLASH_ERASE_ALIGNMENT=0x1000
CONFIG_DISK_VOLUME_SIZE=0x200000
CONFIG_ZTEST=y
+5 −0
Original line number Diff line number Diff line
@@ -9,7 +9,12 @@
#include <fs/fs.h>

#define FATFS_MNTP	"/NAND:"
#if IS_ENABLED(CONFIG_FS_FATFS_LFN)
#define TEST_FILE	FATFS_MNTP \
	"/testlongfilenamethatsmuchlongerthan8.3chars.text"
#else
#define TEST_FILE	FATFS_MNTP"/testfile.txt"
#endif /* IS_ENABLED(CONFIG_FS_FATFS_LFN) */
#define TEST_DIR	FATFS_MNTP"/testdir"
#define TEST_DIR_FILE	FATFS_MNTP"/testdir/testfile.txt"

+4 −0
Original line number Diff line number Diff line
@@ -34,6 +34,10 @@ static int test_file_open(void)

	TC_PRINT("Opened file %s\n", TEST_FILE);

	if (check_file_dir_exists(TEST_FILE)) {
		TC_PRINT("File now exists %s\n", TEST_FILE);
	}

	return res;
}

+4 −0
Original line number Diff line number Diff line
@@ -2,3 +2,7 @@ tests:
  filesystem.fat.api:
    platform_whitelist: native_posix
    tags: filesystem
  filesystem.fat.api.lfn:
    extra_args: CONF_FILE="prj_lfn.conf"
    platform_whitelist: native_posix
    tags: filesystem