Hi,

Version 2 fixes the previous broken patch.

There was a patch named,

[PATCH] Renumber testcases in the symlink01 file, reflecting some added
tests
http://article.gmane.org/gmane.linux.ltp/6987

enabled 2 seems invalid tests, which caused link01 and rename01A test
cases failure,

# ./symlink01 -T link01
link01      1  PASS  :  link(2) to a symbolic link, which is pointing to
an existing object file worked - file created and link
count adjusted
link01      2  PASS  :  link(2) to a symbolic link, which is pointing to
a non-existing object file worked ok - file created and link count
adjusted.
link01      3  BROK  :  lstat(2) Failure when accessing (null) symbolic
link file which should contain (null) path to (null) file

# ./symlink01 -T rename01
rename01    1  PASS  :  rename(3) of symbolic link file name which
points at no object file is ok
rename01    2  PASS  :  rename(3) of symbolic link file name which
points at object file is ok
rename01    3  FAIL  :  Expected EXDEV error for renaming an existing
symbolic link file to a location outside of existing file
system, errno:0 Success

Looking from the code, the first failure looks indeed broken according
to its own comment,

 /* The following link test case is invalid - leaving it defined so */
 /* I don't have to change all the entries in the all_tcses array after link */
 {LINK, 1, -1, -1, creat_symlink, ck_symlink, {NULL, NULL, NULL}},

The second one is because it makes assumption that the link and target
files are located in different filesystems, which is incorrect.

# strace ./symlink01 -T rename01
...
rename("symbolic", "/NiCkEr")           = 0
write(1, "rename01    3  FAIL  :  Expected"..., 152rename01    3  FAIL
:  Expected EXDEV error for renaming an existing symbolic link file to a
location outside of existing file system, errno:0 Success
) = 152
...

This patch reverts some parts of the above patch, and return it to its
original behavior. I have also added some comments there to explain so.

Signed-off-by: CAI Qian <[email protected]>

--- testcases/kernel/syscalls/symlink/symlink01.c.orig  2009-03-13 
16:37:22.000000000 +0800
+++ testcases/kernel/syscalls/symlink/symlink01.c       2009-03-13 
17:52:54.000000000 +0800
@@ -430,6 +430,7 @@
     {LINK, 0, 0, 15, creat_symlink, ck_symlink, {O_FILE, S_FILE, NULL}},
     /* The following link test case is invalid - leaving it defined so */
     /* I don't have to change all the entries in the all_tcses array after 
link */
+    /* It has been disabled at the moment. */
     {LINK, 1, -1, -1, creat_symlink, ck_symlink, {NULL, NULL, NULL}},
     {UNLINK, 0, 0, 16, creat_both, ck_both, {O_FILE, S_FILE, O_FILE}},
     /* 30 */
@@ -441,6 +442,9 @@
     {UTIME, 1, ELOOP, 28, creat_symlink, ck_symlink, {S_FILE, S_FILE, NULL}},
     {RENAME, 0, 0, 21, creat_symlink, ck_symlink, {O_FILE, S_FILE, NULL}},
     {RENAME, 0, 0, 22, creat_both, ck_both, {O_FILE, S_FILE, O_FILE}},
+    /* The following rename test makes assumption that the link and target */
+    /* files are located in different filesystems, which is incorrect. */
+    /* It has been disabled at the moment. */
     {RENAME, 1, EXDEV, 23, creat_both, ck_both, {O_FILE, S_FILE, O_FILE}},
     {OPEN, 0, 0, 24, creat_symlink, ck_symlink, {O_FILE, S_FILE, NULL}},
     /* 40 */
@@ -480,7 +484,7 @@
             "Fail When Removing a Directory File Indirectly from a symlink" },
    { CHDIR,    "chdir",    3, &test_objects[23],
                "Changes CWD Location Indirectly from a symlink" },
-   { LINK,     "link",     3, &test_objects[26],
+   { LINK,     "link",     2, &test_objects[26],
                "Creates a Link To a File Indirectly From a Symbolic" },
    { UNLINK,   "unlink",   1, &test_objects[29],
                "Removes a Link To a File but not the Object File" },
@@ -488,7 +492,7 @@
                "Change Object File Permissions Indirectly From a Symbolic" },
    { UTIME,    "utime",    3, &test_objects[33],
                "Set File Access And Modify Object File Times via symlink" },
-   { RENAME,   "rename",   3, &test_objects[36],
+   { RENAME,   "rename",   2, &test_objects[36],
                "Rename a Symbolic Link File And Not Any Object file" },
    { OPEN,     "open",     5, &test_objects[39],
                "Create/Open a File For Reading Or Writing via symlink" },

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to