1 /*
2  * Copyright (c) 2019 Peter Bigot Consulting, LLC
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /* Directory littlefs operations:
8  * * mkdir
9  * * opendir
10  * * readdir
11  * * closedir
12  * * rename
13  */
14 
15 #include <string.h>
16 #include <zephyr/ztest.h>
17 #include "testfs_tests.h"
18 #include "testfs_lfs.h"
19 #include <lfs.h>
20 
21 #include <zephyr/fs/littlefs.h>
22 
23 void test_fs_dirops(void);
24 
25 /* Mount structure needed by test_fs_basic tests. */
26 struct fs_mount_t *fs_dirops_test_mp = &testfs_small_mnt;
27 
ZTEST(littlefs,test_lfs_dirops)28 ZTEST(littlefs, test_lfs_dirops)
29 {
30 	struct fs_mount_t *mp = &testfs_small_mnt;
31 
32 	zassert_equal(testfs_lfs_wipe_partition(mp),
33 		      TC_PASS,
34 		      "failed to wipe partition");
35 
36 	/* Common dirops tests.
37 	 * (File system is mounted and unmounted during that test.)
38 	 */
39 	test_fs_dirops();
40 }
41