testsuites: Fix fstests/fsrmdirparent testcase

The testcase failed because the rmdir call in that case had two possibilities to fail and the implementation of rmdir checked the other possibility first.

Closes #5071
This commit is contained in:
Loris Nardo
2024-07-28 07:53:50 +02:00
committed by Joel Sherrill
parent 4c3d505811
commit bd7e02d96b
2 changed files with 13 additions and 15 deletions

View File

@@ -39,18 +39,6 @@ actions:
- mimfsfsrenamepermexisting
- mrfsfsrenameexisting
- mrfsfsrenamepermexisting
- set-test-state:
reason: |
Fails because of #5071, dot-dot as last part of a path
is treated as valid
state: expected-fail
tests:
- imfsfsrmdirparent
- jffs2fsrmdirparent
- jffs2nandfsrmdirparent
- mdosfsfsrmdirparent
- mimfsfsrmdirparent
- mrfsfsrmdirparent
- set-test-state:
reason: |
Fails because of #2169 and other rename issue

View File

@@ -52,13 +52,24 @@ static void rmdir_error (void)
const char *wd = __func__;
/*
* Create a new directory and change the current directory to this
* Create a new directory and change the current directory to this
*/
status = mkdir (wd, mode);
rtems_test_assert (status == 0);
status = chdir (wd);
rtems_test_assert (status == 0);
/*
* Try to remove the relative parent directory
*/
EXPECT_EQUAL (-1, rmdir, "..");
puts ("Testing errno for ENOTEMPTY or EBUSY");
if ( errno == ENOTEMPTY || errno == EBUSY ) {
FS_PASS ();
} else {
FS_FAIL ();
}
/*
* Create a new directory for test
*/
@@ -70,8 +81,7 @@ static void rmdir_error (void)
* or there are hard links to the directory other than
* dot or a single entry in dot-dot.
*/
EXPECT_ERROR (ENOTEMPTY, rmdir, "..");
EXPECT_ERROR (ENOTEMPTY, rmdir, "tmp/..");
/*
* Go back to parent directory