Hi!
Pushed with following changes, thanks.
diff --git a/testcases/kernel/syscalls/open/open12.c
b/testcases/kernel/syscalls/open/open12.c
index 8b78b83..5b7576b 100644
--- a/testcases/kernel/syscalls/open/open12.c
+++ b/testcases/kernel/syscalls/open/open12.c
@@ -86,7 +86,7 @@ static void setup(void)
static void test_append(void)
{
- off_t len;
+ off_t len1, len2;
TEST(open(TEST_FILE, O_RDWR | O_APPEND, 0777));
@@ -95,11 +95,12 @@ static void test_append(void)
return;
}
+ len1 = SAFE_LSEEK(cleanup, TEST_RETURN, 0, SEEK_CUR);
SAFE_WRITE(cleanup, 1, TEST_RETURN, TEST_FILE, sizeof(TEST_FILE));
- len = SAFE_LSEEK(cleanup, TEST_RETURN, 0, SEEK_CUR);
+ len2 = SAFE_LSEEK(cleanup, TEST_RETURN, 0, SEEK_CUR);
SAFE_CLOSE(cleanup, TEST_RETURN);
- if (len > (off_t)sizeof(TEST_FILE))
+ if (len2 > len1)
tst_resm(TPASS, "test O_APPEND for open success");
else
tst_resm(TFAIL, "test O_APPEND for open failed");
This makes the test better on -i N (because the len would be greater
than the initial lenght after the first append write no matter what).
@@ -118,10 +119,10 @@ static void test_noatime(void)
return;
}
- if (tst_path_has_mnt_flags(TEST_FILE, flags)) {
+ if (tst_path_has_mnt_flags(cleanup, NULL, flags)) {
tst_resm(TCONF,
"test O_NOATIME flag for open needs filesystems which "
- "are mounted without noatime and relatime");
+ "is mounted without noatime and relatime");
return;
}
This fixes the tst_path_has_mnt_flags() usage. The path to this function
must be full path (not just filename). I've changed the library to use
tst_tmpdir path if NULL is passed as a path (which simplifies the
usage).
@@ -173,7 +174,7 @@ static void test_cloexec(void)
if (pid == 0) {
if (execlp("open12_cloexec", "open12_cloexec", buf, NULL))
- exit(1);
+ exit(2);
}
SAFE_CLOSE(cleanup, TEST_RETURN);
@@ -183,13 +184,14 @@ static void test_cloexec(void)
if (WIFEXITED(status)) {
switch ((int8_t)WEXITSTATUS(status)) {
- case -1:
+ case 0:
tst_resm(TPASS, "test O_CLOEXEC for open success");
- break;
+ break;
case 1:
- tst_brkm(TBROK, cleanup, "execlp() failed");
- default:
tst_resm(TFAIL, "test O_CLOEXEC for open failed");
+ break;
+ default:
+ tst_brkm(TBROK, cleanup, "execlp() failed");
}
} else {
tst_brkm(TBROK, cleanup,
diff --git a/testcases/kernel/syscalls/open/open12_cloexec.c
b/testcases/kernel/syscalls/open/open12_cloexec.c
index 5b55a05..a6dabd5 100644
--- a/testcases/kernel/syscalls/open/open12_cloexec.c
+++ b/testcases/kernel/syscalls/open/open12_cloexec.c
@@ -26,12 +26,12 @@ int main(int argc, char **argv)
int fd;
if (argc != 2) {
- fprintf(stderr, "Only two arguments: %s <fd>", argv[0]);
+ fprintf(stderr, "Only two arguments: %s <fd>\n", argv[0]);
exit(1);
}
fd = atoi(argv[1]);
ret = write(fd, argv[1], strlen(argv[1]));
- exit(ret);
+ return ret != -1;
}
This fixes the return values, because as it was return value 1 was
assigned to both failed execlp() and failed testcase (write() succeded
and returned size of the written data which was 1).
Now execlp failure maps to 2, testcase failure to 1 and success to 0 (in
accordance with shell 0 == succes).
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list