Skip to content

Commit

Permalink
readlink03 test case fix
Browse files Browse the repository at this point in the history
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
nasastry authored and metan-ucw committed Oct 5, 2011
1 parent 53053d8 commit 0cc7514
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion testcases/kernel/syscalls/readlink/readlink03.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -358,4 +363,4 @@ void cleanup()

tst_rmdir();

}
}

0 comments on commit 0cc7514

Please sign in to comment.