Permalink
Browse files

readlink03 test case fix

In readlink03 testcase,
When 'Symlink Pathname is empty' the return value was 'ENOENT' but with
newer kernels the return value is 'EINVAL'. The following patch will fix
this.

readlink03:
Before patch:
...
readlink03    9  TFAIL  :  readlink() failed, Symlink Pathname is empty,
errno=22, expected errno=2
...

After patch:
...
readlink03    9  TPASS  :  readlink(), Symlink Pathname is empty,
returned errno 22
readlink03   10  TPASS  :  readlink(), Symlink Pathname is empty,
returned errno 22
...

Signed-off-by: Nageswara R Sastry <rnsastry@linux.vnet.ibm.com>
Tested-by: Michal Simek <michal.simek@petalogix.com>
  • Loading branch information...
1 parent 53053d8 commit 0cc75148b95e2ed8ecb311f20d91f449461d8860 @nasastry nasastry committed with metan-ucw Sep 12, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 testcases/kernel/syscalls/readlink/readlink03.c
@@ -173,6 +173,11 @@ int main(int ac, char **av)
buf_size = sizeof(buffer);
}
+ if (strncmp(test_desc, "Symlink Pathname is empty", 25) == 0) {
+ if ((tst_kvercmp(2, 6, 39)) >= 0)
+ Test_cases[i].exp_errno = EINVAL;
+ }
+
/*
* Call readlink(2) to test different test conditions.
* verify that it fails with -1 return value and sets
@@ -358,4 +363,4 @@ void cleanup()
tst_rmdir();
-}
+}

0 comments on commit 0cc7514

Please sign in to comment.