diff options
author | Jeremy Allison <jra@samba.org> | 2009-05-27 21:51:15 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-05-27 21:51:15 -0700 |
commit | bccc7ee2c6456cdab08884b826ed5ddc2faf2a54 (patch) | |
tree | 26700fc048211edde5d666011e31445c9adacc4c /source3/torture | |
parent | f55c7614bd7360b484f15c2290ab88195bb78094 (diff) | |
download | samba-bccc7ee2c6456cdab08884b826ed5ddc2faf2a54.tar.gz samba-bccc7ee2c6456cdab08884b826ed5ddc2faf2a54.tar.bz2 samba-bccc7ee2c6456cdab08884b826ed5ddc2faf2a54.zip |
Add cli_posix_readlink() and a torture test for it.
Jeremy.
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/torture.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c index bff8d07f1f..b05ca44f0e 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -4140,6 +4140,7 @@ static bool run_simple_posix_open_test(int dummy) const char *sname = "posix:symlink"; const char *dname = "posix:dir"; char buf[10]; + char namebuf[11]; uint16 major, minor; uint32 caplow, caphigh; uint16_t fnum1 = (uint16_t)-1; @@ -4281,11 +4282,24 @@ static bool run_simple_posix_open_test(int dummy) } else { if (!check_error(__LINE__, cli1, ERRDOS, ERRbadpath, NT_STATUS_OBJECT_PATH_NOT_FOUND)) { + printf("POSIX open of %s should have failed " + "with NT_STATUS_OBJECT_PATH_NOT_FOUND, " + "failed with %s instead.\n", + sname, cli_errstr(cli1)); goto out; } } - /* TODO. Add and test cli_posix_readlink() call. */ + if (!NT_STATUS_IS_OK(cli_posix_readlink(cli1, sname, namebuf, sizeof(namebuf)))) { + printf("POSIX readlink on %s failed (%s)\n", sname, cli_errstr(cli1)); + goto out; + } + + if (strcmp(namebuf, fname) != 0) { + printf("POSIX readlink on %s failed to match name %s (read %s)\n", + sname, fname, namebuf); + goto out; + } if (!NT_STATUS_IS_OK(cli_posix_rmdir(cli1, dname))) { printf("POSIX rmdir failed (%s)\n", cli_errstr(cli1)); |