forked from Imagelibrary/rtems
New fstest to check rename POSIX conformance
This patch is a newer version of the test presented on http://www.rtems.org/pipermail/rtems-devel/2014-February/005318.html Unchecked error cases: - EIO (physical error) - ENOSPC (no space left in the new filepath) - EROFS (already covered on testsuites/fstests/fsrofs01) Untested functionality: - File system lock during rename() operation - If after rename() the link count of a file becomes 0 it should be removed and the space ocupied by the file shall be freed and no longer accessible (the function statvfs() gives "not implemented" on the imfs file system, so this is postponed for now)
This commit is contained in:
committed by
Sebastian Huber
parent
d6da1b1ef4
commit
27d240e050
@@ -31,6 +31,7 @@ SUBDIRS += mimfs_fspermission
|
||||
SUBDIRS += mimfs_fsrdwr
|
||||
SUBDIRS += mimfs_fssymlink
|
||||
SUBDIRS += mimfs_fstime
|
||||
SUBDIRS += mimfs_fsrename
|
||||
SUBDIRS += mrfs_fserror
|
||||
SUBDIRS += mrfs_fslink
|
||||
SUBDIRS += mrfs_fspatheval
|
||||
|
||||
@@ -107,6 +107,7 @@ mimfs_fspermission/Makefile
|
||||
mimfs_fsrdwr/Makefile
|
||||
mimfs_fssymlink/Makefile
|
||||
mimfs_fstime/Makefile
|
||||
mimfs_fsrename/Makefile
|
||||
mrfs_fserror/Makefile
|
||||
mrfs_fslink/Makefile
|
||||
mrfs_fspatheval/Makefile
|
||||
|
||||
19
testsuites/fstests/fsrename/fsrename.doc
Normal file
19
testsuites/fstests/fsrename/fsrename.doc
Normal file
@@ -0,0 +1,19 @@
|
||||
# COPYRIGHT (c) 2014
|
||||
# Andre Marques <andre.lousa.marques at gmail.com>
|
||||
#
|
||||
# The license and distribution terms for this file may be
|
||||
# found in the file LICENSE in this distribution or at
|
||||
# http://www.rtems.org/license/LICENSE.
|
||||
#
|
||||
|
||||
This file describes the directives and concepts tested by this test set.
|
||||
|
||||
test set name: fsrename
|
||||
|
||||
directives:
|
||||
|
||||
+ rename
|
||||
|
||||
concepts:
|
||||
|
||||
+ check if rename implementation conforms to POSIX.1-2008
|
||||
1208
testsuites/fstests/fsrename/test.c
Normal file
1208
testsuites/fstests/fsrename/test.c
Normal file
File diff suppressed because it is too large
Load Diff
30
testsuites/fstests/mimfs_fsrename/Makefile.am
Normal file
30
testsuites/fstests/mimfs_fsrename/Makefile.am
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
rtems_tests_PROGRAMS = mimfs_fsrename
|
||||
mimfs_fsrename_SOURCES = ../fsrename/test.c
|
||||
mimfs_fsrename_SOURCES += ../support/fstest_support.c
|
||||
mimfs_fsrename_SOURCES += ../support/fstest_support.h
|
||||
mimfs_fsrename_SOURCES += ../support/fstest.h
|
||||
mimfs_fsrename_SOURCES += ../../psxtests/include/pmacros.h
|
||||
mimfs_fsrename_SOURCES += ../mimfs_support/fs_support.c
|
||||
mimfs_fsrename_SOURCES += ../mimfs_support/fs_config.h
|
||||
|
||||
dist_rtems_tests_DATA = mimfs_fsrename.scn
|
||||
#dist_rtems_tests_DATA += mimfs_fsrename.doc
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/support
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
|
||||
|
||||
LINK_OBJS = $(mimfs_fsrename_OBJECTS)
|
||||
LINK_LIBS = $(mimfs_fsrename_LDLIBS)
|
||||
|
||||
mimfs_fsrename$(EXEEXT): $(mimfs_fsrename_OBJECTS) $(mimfs_fsrename_DEPENDENCIES)
|
||||
@rm -f mimfs_fsrename$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
287
testsuites/fstests/mimfs_fsrename/mimfs_fsrename.scn
Normal file
287
testsuites/fstests/mimfs_fsrename/mimfs_fsrename.scn
Normal file
@@ -0,0 +1,287 @@
|
||||
*** BEGIN OF TEST FSRENAME MOUNTED IMFS ***
|
||||
Initializing filesystem MOUNTED IMFS
|
||||
|
||||
Old is a simbolic link and rename operates on the simbolic link itself
|
||||
|
||||
Testing rename with arguments: symlink01, name02 EXPECT "0"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 78
|
||||
Testing lstat with arguments: name02, &statbuf EXPECT "0"
|
||||
PASS
|
||||
Testing if name02 is now a symlink
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 86
|
||||
Testing unlink with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: name02 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: symlink01 EXPECT "-1"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 94
|
||||
|
||||
New is a simbolic link and rename operates on the simbolic link itself
|
||||
|
||||
Testing rename with arguments: name02, symlink01 EXPECT "0"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 116
|
||||
Testing lstat with arguments: symlink01, &statbuf EXPECT "0"
|
||||
PASS
|
||||
Testing that symlink01 is not a symlink
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 124
|
||||
Testing unlink with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: name02 EXPECT "-1"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 131
|
||||
Testing unlink with arguments: symlink01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Testing with symbolic link loop's
|
||||
|
||||
Testing rename with arguments: "path01, name01" EXPECT "ELOOP"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 149
|
||||
Testing rename with arguments: "path01, name01" EXPECT "ELOOP"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 152
|
||||
Testing unlink with arguments: name01 EXPECT "-1"
|
||||
PASS
|
||||
Testing unlink with arguments: symlink01 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: symlink02 EXPECT "0"
|
||||
PASS
|
||||
Testing rename with arguments: "name01, path01" EXPECT "ELOOP"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 180
|
||||
Testing rename with arguments: "name01, path01" EXPECT "ELOOP"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 183
|
||||
Testing unlink with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: symlink01 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: symlink02 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename file with itself
|
||||
|
||||
Testing rename with arguments: name01, name01 EXPECT "0"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 244
|
||||
Testing unlink with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename file with itself through a hard link in another directory
|
||||
|
||||
Testing rename with arguments: name01, path01 EXPECT "0"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 271
|
||||
Testing unlink with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: path01 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename directory with file
|
||||
|
||||
Testing rename with arguments: "dir01, name01" EXPECT "ENOTDIR"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 343
|
||||
Testing unlink with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename file with directory
|
||||
|
||||
Testing rename with arguments: "name01, dir01" EXPECT "EISDIR"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 367
|
||||
Testing unlink with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename directory with ancestor directory
|
||||
|
||||
Testing rename with arguments: "dir02, path01" EXPECT "EINVAL"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 390
|
||||
Testing rmdir with arguments: path01 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir02 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename directory with non empty directory
|
||||
|
||||
Testing rename with arguments: dir01, dir02 EXPECT "-1"
|
||||
PASS
|
||||
Testing errno for EEXIST or ENOTEMPTY
|
||||
PASS
|
||||
Testing unlink with arguments: path01 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir02 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename empty directory with another empty directory
|
||||
|
||||
Testing rename with arguments: dir01, dir02 EXPECT "0"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 448
|
||||
Testing rmdir with arguments: dir01 EXPECT "-1"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 454
|
||||
Testing rmdir with arguments: dir02 EXPECT "0"
|
||||
PASS
|
||||
Testing rename with arguments: "dir02, path01" EXPECT "EMLINK"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 483
|
||||
Testing rmdir with arguments: path01 EXPECT "-1"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 497
|
||||
Testing rmdir with arguments: dir02 EXPECT "0"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 498
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename files within directories protected with S_ISVTX
|
||||
|
||||
Testing rename with arguments: path01, name02 EXPECT "-1"
|
||||
PASS
|
||||
Testing errno for EPERM or EACCES
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 535
|
||||
Testing unlink with arguments: path01 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: name02 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
Testing rename with arguments: name02, path01 EXPECT "-1"
|
||||
PASS
|
||||
Testing errno for EPERM or EACCES
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 577
|
||||
Testing unlink with arguments: path01 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: name02 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename file with non existant file
|
||||
|
||||
Testing rename with arguments: name01, name02 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: name01 EXPECT "-1"
|
||||
PASS
|
||||
Testing unlink with arguments: name02 EXPECT "0"
|
||||
PASS
|
||||
Testing rename with arguments: "name02, name01" EXPECT "ENOENT"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 660
|
||||
Testing unlink with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: name02 EXPECT "-1"
|
||||
PASS
|
||||
|
||||
Rename file with non existant filepath
|
||||
|
||||
Testing rename with arguments: "path01, name01" EXPECT "ENOENT"
|
||||
PASS
|
||||
Testing unlink with arguments: name01 EXPECT "-1"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename directory with non existant directory
|
||||
|
||||
Testing rename with arguments: dir01, dir02 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir01 EXPECT "-1"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir02 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename file with a name size exceeding NAME_MAX
|
||||
|
||||
Testing rename with arguments: "name01, filename" EXPECT "ENAMETOOLONG"
|
||||
PASS
|
||||
Testing unlink with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
Testing unlink with arguments: filename EXPECT "-1"
|
||||
PASS
|
||||
|
||||
Rename directory with current directory
|
||||
|
||||
Testing rename with arguments: "." , dir01 EXPECT "-1"
|
||||
PASS
|
||||
Testing errno for EINVAL or EBUSY
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 787
|
||||
Testing rename with arguments: dir01, "." EXPECT "-1"
|
||||
PASS
|
||||
Testing errno for EINVAL or EBUSY
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 801
|
||||
|
||||
Rename directory with previous directory
|
||||
|
||||
Testing rename with arguments: ".." , dir01 EXPECT "-1"
|
||||
PASS
|
||||
Testing errno for EINVAL or EBUSY
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 817
|
||||
Testing rename with arguments: dir01, ".." EXPECT "-1"
|
||||
PASS
|
||||
Testing errno for EINVAL or EBUSY
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 831
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Testing empty filepaths
|
||||
|
||||
Testing rename with arguments: "name01, \"\"" EXPECT "ENOENT"
|
||||
PASS
|
||||
Testing with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
Testing rename with arguments: "\"\", name01" EXPECT "ENOENT"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 869
|
||||
Testing with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename two files on a directory with no write permission
|
||||
|
||||
Testing rename with arguments: "name01 , name02" EXPECT "EACCES"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 947
|
||||
|
||||
Rename file between two directories, with and without write access
|
||||
|
||||
Testing rename with arguments: "name01, path01" EXPECT "EACCES"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 971
|
||||
Testing rename with arguments: "path01, name01" EXPECT "EACCES"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 978
|
||||
Testing with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
Testing with arguments: path01 EXPECT "0"
|
||||
PASS
|
||||
Testing with arguments: path01 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir02 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename two files on a directory with no execute permission
|
||||
|
||||
Testing rename with arguments: "path01 , path02" EXPECT "EACCES"
|
||||
PASS
|
||||
|
||||
Rename file between two directories, with and without execute access
|
||||
|
||||
Testing rename with arguments: "path01, path02" EXPECT "EACCES"
|
||||
PASS
|
||||
Testing rename with arguments: "path02, path01" EXPECT "EACCES"
|
||||
FAIL testsuites/fstests/mimfs_fsrename/../fsrename/test.c: 1103
|
||||
Testing with arguments: path01 EXPECT "0"
|
||||
PASS
|
||||
Testing with arguments: path01 EXPECT "0"
|
||||
PASS
|
||||
Testing with arguments: path02 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir01 EXPECT "0"
|
||||
PASS
|
||||
Testing rmdir with arguments: dir02 EXPECT "0"
|
||||
PASS
|
||||
|
||||
Rename files across diferent filesystems
|
||||
|
||||
Testing rename with arguments: "name01, path01" EXPECT "EXDEV"
|
||||
PASS
|
||||
Testing with arguments: path01 EXPECT "-1"
|
||||
PASS
|
||||
Testing with arguments: name01 EXPECT "0"
|
||||
PASS
|
||||
|
||||
|
||||
Shutting down filesystem MOUNTED IMFS
|
||||
*** END OF TEST FSRENAME MOUNTED IMFS ***
|
||||
Reference in New Issue
Block a user