Hi Jakub,

I am bit puzzled here, since all the test files get created/destroyed under TEST_DIR and runs well(absolute paths are already provided), so why do we need to change current working dir to TEST_DIR (use of tests_set_cwd) before running test?


On Mon, Apr 15, 2013 at 3:58 PM, Jakub Hrozek <jhrozek@redhat.com> wrote:
On Sat, Apr 13, 2013 at 02:38:45AM +0530, Abhishek Singh wrote:
> Please check this patch, previous patch contained extra changes which is
> not required.
>

I would prefer if the src/conf_macros.m4 and src/tests/common.c changes
were a separate patch (with attribution set to Lukas) But more importantly:

@@ -113,8 +121,8 @@ void test_sss_openat_cloexec_success(void **state)
     char path[PATH_MAX] = {'\0'};
     const char *relativepath;

-    relativepath = strchr(get_filepath(path), 't');
     dir_fd = dirfd((DIR *)*state);
+    relativepath = get_filepath(path) + strlen(TEST_DIR) + 1;

This is still guesswork, can you simply use basename() here? See man 3 basename,
I think you could easily call basename() on the return value of get_filepath().

Also the test still doesn't call tests_set_cwd(). It should call it right before
calling run_tests, I think.