Skip to content

Commit 759a167

Browse files
committed
aiodio: Skip tests on tmpfs
tmpfs does not support O_DIRECT. Used only on newly rewritten tests (old are currently using hardcoded paths in the runtest files). Reviewed-by: Cyril Hrubis <[email protected]> Reviewed-by: Martin Doucha <[email protected]> Acked-by: Andrea Cervesato <[email protected]> Signed-off-by: Petr Vorel <[email protected]>
1 parent f3caabe commit 759a167

File tree

5 files changed

+32
-6
lines changed

5 files changed

+32
-6
lines changed

testcases/kernel/io/ltp-aiodio/aiodio_append.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ static void setup(void)
131131

132132
static void cleanup(void)
133133
{
134-
*run_child = 0;
135-
SAFE_MUNMAP(run_child, sizeof(int));
134+
if (run_child) {
135+
*run_child = 0;
136+
SAFE_MUNMAP(run_child, sizeof(int));
137+
}
136138
}
137139

138140
static void run(void)
@@ -177,6 +179,10 @@ static struct tst_test test = {
177179
{"b:", &str_numaio, "Number of async IO blocks (default 16)"},
178180
{}
179181
},
182+
.skip_filesystems = (const char *[]) {
183+
"tmpfs",
184+
NULL
185+
},
180186
};
181187
#else
182188
TST_TEST_TCONF("test requires libaio and its development packages");

testcases/kernel/io/ltp-aiodio/dio_append.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,8 @@ static struct tst_test test = {
9393
{"c:", &str_appends, "Number of appends (default 1000)"},
9494
{}
9595
},
96+
.skip_filesystems = (const char *[]) {
97+
"tmpfs",
98+
NULL
99+
},
96100
};

testcases/kernel/io/ltp-aiodio/dio_read.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,8 @@ static struct tst_test test = {
177177
{"s:", &str_filesize, "File size (default 128M)"},
178178
{}
179179
},
180+
.skip_filesystems = (const char *[]) {
181+
"tmpfs",
182+
NULL
183+
},
180184
};

testcases/kernel/io/ltp-aiodio/dio_sparse.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ static void setup(void)
8383

8484
static void cleanup(void)
8585
{
86-
*run_child = 0;
87-
SAFE_MUNMAP(run_child, sizeof(int));
86+
if (run_child) {
87+
*run_child = 0;
88+
SAFE_MUNMAP(run_child, sizeof(int));
89+
}
8890
}
8991

9092
static void run(void)
@@ -129,4 +131,8 @@ static struct tst_test test = {
129131
{"o:", &str_offset, "File offset (default 0)"},
130132
{}
131133
},
134+
.skip_filesystems = (const char *[]) {
135+
"tmpfs",
136+
NULL
137+
},
132138
};

testcases/kernel/io/ltp-aiodio/dio_truncate.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ static void setup(void)
107107

108108
static void cleanup(void)
109109
{
110-
*run_child = 0;
111-
SAFE_MUNMAP(run_child, sizeof(int));
110+
if (run_child) {
111+
*run_child = 0;
112+
SAFE_MUNMAP(run_child, sizeof(int));
113+
}
112114
}
113115

114116
static void run(void)
@@ -163,4 +165,8 @@ static struct tst_test test = {
163165
{"c:", &str_numwrites, "Number of append & truncate (default 100)"},
164166
{}
165167
},
168+
.skip_filesystems = (const char *[]) {
169+
"tmpfs",
170+
NULL
171+
},
166172
};

0 commit comments

Comments
 (0)